SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
|
Email
Search
Test your basic knowledge |
Perl Programming
Start Test
Study First
Subject
:
it-skills
Instructions:
Answer 50 questions in 15 minutes.
If you are not ready to take this test, you can
study here
.
Match each statement with the correct term.
Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.
This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. The three basic ________ of the open() function: > write - >> append - < read file
newline
foreach
keys(%hash)
access modes
2. _________ $#arrayName give value of last index available in the array. Ex an array of size 5 will have its $#arrayName = 4
execution block
Special array
array functions
%hashname = (key1=>"value1", key2=>"value2", key3=>"Value3")
3. eq - ne - lt - le - gt - ge
size string comparison operators
length($string)
use moduleName; Ex: use Roman;
push(@array, $newValue)
4. Returns the sub string starting at index $startindex and ending after $numchars chars in the string $string
push(@array, $newValue)
ucfirst($string)
substr($string, $startindex, $numchars)
Scalar variables
5. To include modules in perl
use moduleName; Ex: use Roman;
similar data types
keys(%hash)
@entireFile=<FILEHANDLE>
6. The __________ in perl: - uses grave marks `command args`- returns the output of the command to the variable you specify - if $output = `command arg` the output is stored all in one variable (all lines seperated by n) - if @output = `command arg` the
basic binding operators
ucfirst($string)
command substitution
Scalar variables
7. Returns a copy of the string with the first letter lower case
Array variables
lcfirst($string)
Expression Quantifiers
lc($string)
8. Sort and array alphabetically
delete($hashName{key})
split(/\s/, $string)
sort(@array)
values(%hash)
9. ________ in perl - can be scalar array or hash context - tells the interpreter what you are looking for (Ex: "$arrayname[$index_number]")
like functions
scalar
Variable context
command substitution
10. Swap keys for values and values for keys. Will cause issues if there are multiple hash entries with the same value
@entireFile=<FILEHANDLE>
basic binding operators
access modes
reverse(%hashName)
11. To read an entire file into an array (one line per element)
arithmetic comparison operators
flow-control
like functions
@entireFile=<FILEHANDLE>
12. The use of "if" "if-else" and "if-elsif-else"
similar data types
substr($string, $startindex, $numchars)
flow-control
FILEHANDLE
13. Removes the first element of the array shift
(@array)
like functions
@arrayName size
print(FILEHANDLE "Data to outputn");
14. The two phases of creating a PERL program _______ - Execution
similar data types
Editing
ucfirst($string)
chomp($string)
15. Join the elements of the array seperating the elements with the ':' character
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
16. Delete the hash entry with the key given
command substitution
delete($hashName{key})
$line=<FILEHANDLE>
flow-control
17. Returns a copy of the string as all upper case
@arrayName size
uc($string)
Assignment
Special array
18. Common ________: keys(%hash) - values(%hash) - each(%hash) - delete($hash{keyName}) - exists($hash{keyName}) - reverse(%hash)
size string comparison operators
arithmetic comparison operators
hash functions
join(':', @array)
19. The variable that provides the last index of an array
chomp($string)
$#arrayName
Expression character classes
(@array)
20. Stores information about the current users environment. You can print this from the command line using printenv
access modes
$line=<FILEHANDLE>
%ENV hash array
length($string)
21. In perl the _______ will recognize syntax errors and halt execution BEFORE it begins - and will output statements; it does not understand and the line which it encountered the error on
interpreter
Hash variables
each(%hash)
newline
22. scalar(@arrayName) returns the ______ of the array names
foreach
flow-control
@arrayName size
unshift(@array, $newValue)
23. Assignment of hash variables in perl (when oringally defining the hash)
Hash variables
access modes
reverse(@array)
%hashname = (key1=>"value1", key2=>"value2", key3=>"Value3")
24. Modules in perl - Synonymous with header files in C - Collection of ______ and variables that may be used in your program
like functions
$hashName{keyName}="Value to Add"
execution block
length($string)
25. $#arrayName returns the value of the ______ of the array (NOT the data stored in that array element)
last index
Scalar variables
(@array)
flow-control
26. < - > - == - <= - >= - !=
unshift(@array, $newValue)
chomp(@string)
arithmetic comparison operators
newline
27. Returns a two element ray of the next key value pair; resultArray[0] is the key resultArray[1] is the value
exists($hashName{keyName})
size string comparison operators
each(%hash)
lcfirst($string)
28. Two ____________ in regular expressions: =~ Contains - !~ Does not contain
unshift(@array, $newValue)
@arrayName size
basic binding operators
Expression Quantifiers
29. Returns a copy of the string with the first letter upper case
execution block
ucfirst($string)
lc($string)
@ARGV
30. Removes the last element from the array pop
execution block
(@array)
system() function
chomp($string)
31. The use of ______ in perl - Documenting code - Created by placing a "#" on a line. - are not multi-line
comments
use moduleName; Ex: use Roman;
print(FILEHANDLE "Data to outputn");
@ARGV
32. _________ in perl - An associative array
Array variables
push(@array, $newValue)
arithmetic comparison operators
Hash variables
33. _________ in perl - Singular variable - starts with "$" - Number or characer or string- Perl does automatic type conversion of these
$#arrayName
system commands
command substitution
Scalar variables
34. _________ @arrayName) returns the size of the array
chomp(@string)
array functions
Scalar variables
scalar
35. Returns all of the keys of the hash as an array
substr($string, $startindex, $numchars)
@arrayName size
chomp(@string)
keys(%hash)
36. Explain how to read a line from a file handle
$line=<FILEHANDLE>
ucfirst($string)
uc($string)
access modes
37. Regular __________: * - 0 or more characters - + - 1 or more characters - ? - 0 or 1 characters
sort(@array)
$line=<FILEHANDLE>
Hash variables
Expression Quantifiers
38. The two primary methods of executing _______ in perl: - system("command args") - - `command args`
Scalar variables
arithmetic comparison operators
system commands
chomp(@string)
39. Arrays can be assigned or read in _________
flow-control
use moduleName; Ex: use Roman;
uc($string)
scalar context (Ex: $myArray[4] = 2)
40. Common ________: pop(@array) - push(@array, $new Value) - shift(@array) - unshift(@array, $newValue) - sort(@array) - reverse(@array)
array functions
(@array)
lcfirst($string)
each(%hash)
41. Removes trailing newline
print(FILEHANDLE "Data to outputn");
chomp($string)
delete($hashName{key})
@ARGV
42. To write to a filehandle
(@array)
print(FILEHANDLE "Data to outputn");
size string comparison operators
each(%hash)
43. Returns a copy of the string as all lower case
Variable context
@arrayName size
keys(%hash)
lc($string)
44. Adds a new element to end of the array with value $newValue
push(@array, $newValue)
sort(@array)
each(%hash)
foreach
45. A special system variable used to pass arguments to script
delete($hashName{key})
newline
@ARGV
Expression Quantifiers
46. Regular ____________: w - alphanumeric word including underscor - d - digits 0-9 - s any whitespace - . - any character
Scalar variables
Expression character classes
%hashname = (key1=>"value1", key2=>"value2", key3=>"Value3")
delete($hashName{key})
47. Add a new element to the from of the array with the value $newwValue
lc($string)
unshift(@array, $newValue)
newline
exists($hashName{keyName})
48. Returns all of the values of the hash as an array
reverse(@array)
push(@array, $newValue)
values(%hash)
Variable context
49. The four types of loops in perl: while - until - for - ________
@arrayName size
hash functions
Expression Quantifiers
foreach
50. Assignment of a hash variable for a single hash element
command substitution
$hashName{keyName}="Value to Add"
lcfirst($string)
Variable context
Sorry!:) No result found.
Can you answer 50 questions in 15 minutes?
Let me suggest you:
Browse all subjects
Browse all tests
Most popular tests
Major Subjects
Tests & Exams
AP
CLEP
DSST
GRE
SAT
GMAT
Certifications
CISSP go to https://www.isc2.org/
PMP
ITIL
RHCE
MCTS
More...
IT Skills
Android Programming
Data Modeling
Objective C Programming
Basic Python Programming
Adobe Illustrator
More...
Business Skills
Advertising Techniques
Business Accounting Basics
Business Strategy
Human Resource Management
Marketing Basics
More...
Soft Skills
Body Language
People Skills
Public Speaking
Persuasion
Job Hunting And Resumes
More...
Vocabulary
GRE Vocab
SAT Vocab
TOEFL Essential Vocab
Basic English Words For All
Global Words You Should Know
Business English
More...
Languages
AP German Vocab
AP Latin Vocab
SAT Subject Test: French
Italian Survival
Norwegian Survival
More...
Engineering
Audio Engineering
Computer Science Engineering
Aerospace Engineering
Chemical Engineering
Structural Engineering
More...
Health Sciences
Basic Nursing Skills
Health Science Language Fundamentals
Veterinary Technology Medical Language
Cardiology
Clinical Surgery
More...
English
Grammar Fundamentals
Literary And Rhetorical Vocab
Elements Of Style Vocab
Introduction To English Major
Complete Advanced Sentences
Literature
Homonyms
More...
Math
Algebra Formulas
Basic Arithmetic: Measurements
Metric Conversions
Geometric Properties
Important Math Facts
Number Sense Vocab
Business Math
More...
Other Major Subjects
Science
Economics
History
Law
Performing-arts
Cooking
Logic & Reasoning
Trivia
Browse all subjects
Browse all tests
Most popular tests