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. Removes the last element from the array pop
%ENV hash array
(@array)
like functions
lcfirst($string)
2. < - > - == - <= - >= - !=
arithmetic comparison operators
(@array)
basic binding operators
@ARGV
3. To include modules in perl
flow-control
use moduleName; Ex: use Roman;
Scalar variables
sort(@array)
4. _________ @arrayName) returns the size of the array
%ENV hash array
foreach
scalar
length($string)
5. 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
6. scalar(@arrayName) returns the ______ of the array names
reverse(@array)
hash functions
@arrayName size
$line=<FILEHANDLE>
7. The use of "if" "if-else" and "if-elsif-else"
comments
join(':', @array)
ucfirst($string)
flow-control
8. The four types of loops in perl: while - until - for - ________
reverse(%hashName)
unshift(@array, $newValue)
$line=<FILEHANDLE>
foreach
9. ________ in perl - can be scalar array or hash context - tells the interpreter what you are looking for (Ex: "$arrayname[$index_number]")
last index
Variable context
Hash variables
%hashname = (key1=>"value1", key2=>"value2", key3=>"Value3")
10. Assignment of hash variables in perl (when oringally defining the hash)
%ENV hash array
%hashname = (key1=>"value1", key2=>"value2", key3=>"Value3")
split(/\s/, $string)
reverse(@array)
11. Add a new element to the from of the array with the value $newwValue
unshift(@array, $newValue)
system commands
uc($string)
values(%hash)
12. Regular __________: * - 0 or more characters - + - 1 or more characters - ? - 0 or 1 characters
string manipulation functions
Expression Quantifiers
split(/\s/, $string)
Variable context
13. _________ $#arrayName give value of last index available in the array. Ex an array of size 5 will have its $#arrayName = 4
reverse(%hashName)
last index
Special array
Variable context
14. _________ in perl - Singular variable - starts with "$" - Number or characer or string- Perl does automatic type conversion of these
Scalar variables
@entireFile=<FILEHANDLE>
lc($string)
scalar context (Ex: $myArray[4] = 2)
15. Returns a copy of the string as all upper case
substr($string, $startindex, $numchars)
$line=<FILEHANDLE>
Scalar variables
uc($string)
16. The two phases of creating a PERL program _______ - Execution
values(%hash)
Editing
reverse(%hashName)
delete($hashName{key})
17. The _______ in perl: - used to execute an external command - will output results of command to terminal - returns the exit status of the program that ran - use this for commands that you dont care about SAVING the output to a variable
Hash variables
system() function
(@array)
keys(%hash)
18. Removes the first element of the array shift
(@array)
Special array
foreach
Editing
19. To read an entire file into an array (one line per element)
@entireFile=<FILEHANDLE>
@arrayName size
similar data types
Scalar variables
20. $#arrayName returns the value of the ______ of the array (NOT the data stored in that array element)
execution block
last index
push(@array, $newValue)
@entireFile=<FILEHANDLE>
21. Returns a two element ray of the next key value pair; resultArray[0] is the key resultArray[1] is the value
each(%hash)
Special array
@entireFile=<FILEHANDLE>
@arrayName size
22. To write to a filehandle
length($string)
last index
like functions
print(FILEHANDLE "Data to outputn");
23. The use of ______ in perl - Documenting code - Created by placing a "#" on a line. - are not multi-line
(@array)
interpreter
Expression Quantifiers
comments
24. Returns all of the keys of the hash as an array
keys(%hash)
unshift(@array, $newValue)
Variable context
delete($hashName{key})
25. Returns a copy of the string with the first letter lower case
$hashName{keyName}="Value to Add"
lcfirst($string)
Expression Quantifiers
system() function
26. Common ________: keys(%hash) - values(%hash) - each(%hash) - delete($hash{keyName}) - exists($hash{keyName}) - reverse(%hash)
hash functions
newline
scalar
system() function
27. Common ___________: substr($string, $start, $numchars); - length($string) - lc($string) - uc($string) - chomp($string) - chomp(@string) - join(':", @string) - split(/\s/, $string) - lcfirst($string) - ucfirst($string)
delete($hashName{key})
reverse(%hashName)
arithmetic comparison operators
string manipulation functions
28. The variable that provides the last index of an array
$#arrayName
chomp(@string)
arithmetic comparison operators
uc($string)
29. Remove trailing newline from each element in the array
chomp(@string)
command substitution
Scalar variables
uc($string)
30. Sort and array alphabetically
sort(@array)
comments
chomp($string)
$line=<FILEHANDLE>
31. Stores information about the current users environment. You can print this from the command line using printenv
FILEHANDLE
Special array
%ENV hash array
Expression Quantifiers
32. Swap keys for values and values for keys. Will cause issues if there are multiple hash entries with the same value
foreach
size string comparison operators
Scalar variables
reverse(%hashName)
33. Removes trailing newline
chomp($string)
@entireFile=<FILEHANDLE>
Expression Quantifiers
(@array)
34. 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
Assignment
scalar
unshift(@array, $newValue)
35. Two ____________ in regular expressions: =~ Contains - !~ Does not contain
length($string)
Hash variables
basic binding operators
reverse(%hashName)
36. Arrays can be assigned or read in _________
scalar context (Ex: $myArray[4] = 2)
like functions
chomp(@string)
array functions
37. Split string into an array using spaces as delimeter
$#arrayName
Variable context
array functions
split(/\s/, $string)
38. Reverses the elements of the array
values(%hash)
access modes
flow-control
reverse(@array)
39. _________ of scalar variables in perl - using "=" - Ex: $myVariable = 5;
Assignment
$line=<FILEHANDLE>
sort(@array)
execution block
40. Does the hash key with "keyName" exists
%hashname = (key1=>"value1", key2=>"value2", key3=>"Value3")
Assignment
uc($string)
exists($hashName{keyName})
41. Common ________: pop(@array) - push(@array, $new Value) - shift(@array) - unshift(@array, $newValue) - sort(@array) - reverse(@array)
push(@array, $newValue)
array functions
use moduleName; Ex: use Roman;
lc($string)
42. In arrays elements need not be __________
similar data types
system commands
chomp($string)
Variable context
43. Delete the hash entry with the key given
Scalar variables
array functions
Assignment
delete($hashName{key})
44. Returns the length of the string including escape sequences
Hash variables
newline
length($string)
keys(%hash)
45. Modules in perl - Synonymous with header files in C - Collection of ______ and variables that may be used in your program
Expression character classes
%ENV hash array
like functions
arithmetic comparison operators
46. eq - ne - lt - le - gt - ge
Special array
size string comparison operators
Expression character classes
Array variables
47. Returns all of the values of the hash as an array
values(%hash)
Special array
Array variables
(@array)
48. Returns a copy of the string with the first letter upper case
use moduleName; Ex: use Roman;
ucfirst($string)
Assignment
basic binding operators
49. The purpose of {} in an "if" statement: To Define the __________ of the if statement. Unlike C the {} braces ARE REQUIRED
newline
split(/\s/, $string)
execution block
command substitution
50. To get rid of the ________ in $line you could now chomp() (Ex: chomp($line);)
newline
%ENV hash array
system commands
system() function
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