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. Returns a copy of the string with the first letter lower case
reverse(%hashName)
Array variables
lcfirst($string)
print(FILEHANDLE "Data to outputn");
2. The three basic ________ of the open() function: > write - >> append - < read file
Editing
$line=<FILEHANDLE>
access modes
Array variables
3. $#arrayName returns the value of the ______ of the array (NOT the data stored in that array element)
delete($hashName{key})
last index
%ENV hash array
system commands
4. The use of "if" "if-else" and "if-elsif-else"
(@array)
execution block
flow-control
chomp($string)
5. Stores information about the current users environment. You can print this from the command line using printenv
similar data types
%ENV hash array
chomp(@string)
Editing
6. In arrays elements need not be __________
unshift(@array, $newValue)
Editing
Assignment
similar data types
7. Returns the length of the string including escape sequences
reverse(@array)
length($string)
@ARGV
comments
8. Returns a copy of the string with the first letter upper case
like functions
%ENV hash array
ucfirst($string)
arithmetic comparison operators
9. 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
command substitution
Array variables
string manipulation functions
unshift(@array, $newValue)
10. Common ___________: substr($string, $start, $numchars); - length($string) - lc($string) - uc($string) - chomp($string) - chomp(@string) - join(':", @string) - split(/\s/, $string) - lcfirst($string) - ucfirst($string)
foreach
Expression character classes
string manipulation functions
substr($string, $startindex, $numchars)
11. _________ @arrayName) returns the size of the array
system() function
$#arrayName
scalar
Assignment
12. 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
$hashName{keyName}="Value to Add"
Hash variables
(@array)
system() function
13. Returns a copy of the string as all lower case
push(@array, $newValue)
each(%hash)
lc($string)
Array variables
14. The two primary methods of executing _______ in perl: - system("command args") - - `command args`
comments
$hashName{keyName}="Value to Add"
interpreter
system commands
15. Removes trailing newline
Assignment
exists($hashName{keyName})
chomp($string)
scalar
16. ________ in perl - can be scalar array or hash context - tells the interpreter what you are looking for (Ex: "$arrayname[$index_number]")
keys(%hash)
exists($hashName{keyName})
system commands
Variable context
17. 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
18. Modules in perl - Synonymous with header files in C - Collection of ______ and variables that may be used in your program
like functions
flow-control
exists($hashName{keyName})
array functions
19. Assignment of hash variables in perl (when oringally defining the hash)
substr($string, $startindex, $numchars)
interpreter
%hashname = (key1=>"value1", key2=>"value2", key3=>"Value3")
Scalar variables
20. ________ in perl - A collection of data (static data or scalar variables or arrays or hashes can all be stored in an array element)
command substitution
last index
@arrayName size
Array variables
21. Returns a copy of the string as all upper case
uc($string)
hash functions
lcfirst($string)
use moduleName; Ex: use Roman;
22. Assignment of a hash variable for a single hash element
unshift(@array, $newValue)
Editing
$line=<FILEHANDLE>
$hashName{keyName}="Value to Add"
23. To read an entire file into an array (one line per element)
delete($hashName{key})
arithmetic comparison operators
Variable context
@entireFile=<FILEHANDLE>
24. Add a new element to the from of the array with the value $newwValue
join(':', @array)
$#arrayName
delete($hashName{key})
unshift(@array, $newValue)
25. To get rid of the ________ in $line you could now chomp() (Ex: chomp($line);)
command substitution
arithmetic comparison operators
newline
interpreter
26. Removes the last element from the array pop
FILEHANDLE
(@array)
system commands
chomp(@string)
27. Does the hash key with "keyName" exists
exists($hashName{keyName})
$hashName{keyName}="Value to Add"
access modes
Expression Quantifiers
28. The four types of loops in perl: while - until - for - ________
$#arrayName
values(%hash)
foreach
Scalar variables
29. < - > - == - <= - >= - !=
arithmetic comparison operators
Special array
print(FILEHANDLE "Data to outputn");
string manipulation functions
30. Reverses the elements of the array
scalar context (Ex: $myArray[4] = 2)
sort(@array)
reverse(@array)
delete($hashName{key})
31. The open() statement in perl: open(________, file_mode, "filename.txt")
FILEHANDLE
@entireFile=<FILEHANDLE>
Expression Quantifiers
@ARGV
32. Adds a new element to end of the array with value $newValue
Expression Quantifiers
use moduleName; Ex: use Roman;
push(@array, $newValue)
%ENV hash array
33. Arrays can be assigned or read in _________
@arrayName size
scalar context (Ex: $myArray[4] = 2)
Expression character classes
Array variables
34. Common ________: pop(@array) - push(@array, $new Value) - shift(@array) - unshift(@array, $newValue) - sort(@array) - reverse(@array)
interpreter
array functions
Array variables
use moduleName; Ex: use Roman;
35. 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
Expression Quantifiers
interpreter
(@array)
last index
36. Removes the first element of the array shift
newline
(@array)
keys(%hash)
system() function
37. Sort and array alphabetically
sort(@array)
similar data types
values(%hash)
access modes
38. Explain how to read a line from a file handle
use moduleName; Ex: use Roman;
$line=<FILEHANDLE>
join(':', @array)
Expression character classes
39. A special system variable used to pass arguments to script
reverse(@array)
hash functions
Expression Quantifiers
@ARGV
40. Split string into an array using spaces as delimeter
substr($string, $startindex, $numchars)
comments
split(/\s/, $string)
exists($hashName{keyName})
41. The two phases of creating a PERL program _______ - Execution
Expression Quantifiers
flow-control
system() function
Editing
42. The use of ______ in perl - Documenting code - Created by placing a "#" on a line. - are not multi-line
comments
chomp(@string)
$hashName{keyName}="Value to Add"
chomp($string)
43. Regular __________: * - 0 or more characters - + - 1 or more characters - ? - 0 or 1 characters
Expression Quantifiers
sort(@array)
scalar context (Ex: $myArray[4] = 2)
use moduleName; Ex: use Roman;
44. Common ________: keys(%hash) - values(%hash) - each(%hash) - delete($hash{keyName}) - exists($hash{keyName}) - reverse(%hash)
Array variables
sort(@array)
$#arrayName
hash functions
45. _________ in perl - Singular variable - starts with "$" - Number or characer or string- Perl does automatic type conversion of these
hash functions
similar data types
ucfirst($string)
Scalar variables
46. Returns the sub string starting at index $startindex and ending after $numchars chars in the string $string
keys(%hash)
substr($string, $startindex, $numchars)
Editing
length($string)
47. To include modules in perl
use moduleName; Ex: use Roman;
push(@array, $newValue)
delete($hashName{key})
print(FILEHANDLE "Data to outputn");
48. To write to a filehandle
length($string)
print(FILEHANDLE "Data to outputn");
system commands
@ARGV
49. Returns all of the values of the hash as an array
(@array)
uc($string)
values(%hash)
comments
50. Returns all of the keys of the hash as an array
keys(%hash)
length($string)
$hashName{keyName}="Value to Add"
newline
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