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. Regular __________: * - 0 or more characters - + - 1 or more characters - ? - 0 or 1 characters
Expression Quantifiers
exists($hashName{keyName})
values(%hash)
access modes
2. The use of "if" "if-else" and "if-elsif-else"
system commands
interpreter
flow-control
@entireFile=<FILEHANDLE>
3. Explain how to read a line from a file handle
last index
$#arrayName
use moduleName; Ex: use Roman;
$line=<FILEHANDLE>
4. Two ____________ in regular expressions: =~ Contains - !~ Does not contain
%hashname = (key1=>"value1", key2=>"value2", key3=>"Value3")
Array variables
basic binding operators
uc($string)
5. Removes the last element from the array pop
(@array)
each(%hash)
lc($string)
access modes
6. Modules in perl - Synonymous with header files in C - Collection of ______ and variables that may be used in your program
delete($hashName{key})
reverse(%hashName)
like functions
similar data types
7. Adds a new element to end of the array with value $newValue
push(@array, $newValue)
values(%hash)
chomp($string)
Expression character classes
8. Returns all of the values of the hash as an array
%ENV hash array
values(%hash)
print(FILEHANDLE "Data to outputn");
Array variables
9. < - > - == - <= - >= - !=
access modes
@ARGV
arithmetic comparison operators
$hashName{keyName}="Value to Add"
10. ________ in perl - can be scalar array or hash context - tells the interpreter what you are looking for (Ex: "$arrayname[$index_number]")
Variable context
keys(%hash)
@arrayName size
hash functions
11. 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
12. Removes the first element of the array shift
lcfirst($string)
Array variables
(@array)
arithmetic comparison operators
13. Assignment of hash variables in perl (when oringally defining the hash)
use moduleName; Ex: use Roman;
$#arrayName
execution block
%hashname = (key1=>"value1", key2=>"value2", key3=>"Value3")
14. Returns a copy of the string as all upper case
uc($string)
scalar context (Ex: $myArray[4] = 2)
print(FILEHANDLE "Data to outputn");
chomp($string)
15. Returns the sub string starting at index $startindex and ending after $numchars chars in the string $string
keys(%hash)
last index
substr($string, $startindex, $numchars)
command substitution
16. Delete the hash entry with the key given
arithmetic comparison operators
similar data types
Array variables
delete($hashName{key})
17. eq - ne - lt - le - gt - ge
comments
size string comparison operators
keys(%hash)
use moduleName; Ex: use Roman;
18. Returns a copy of the string with the first letter upper case
basic binding operators
ucfirst($string)
system commands
Special array
19. The two primary methods of executing _______ in perl: - system("command args") - - `command args`
Assignment
flow-control
system commands
Expression character classes
20. 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
similar data types
system() function
Expression character classes
delete($hashName{key})
21. The purpose of {} in an "if" statement: To Define the __________ of the if statement. Unlike C the {} braces ARE REQUIRED
print(FILEHANDLE "Data to outputn");
reverse(@array)
command substitution
execution block
22. Sort and array alphabetically
sort(@array)
arithmetic comparison operators
substr($string, $startindex, $numchars)
exists($hashName{keyName})
23. $#arrayName returns the value of the ______ of the array (NOT the data stored in that array element)
join(':', @array)
use moduleName; Ex: use Roman;
newline
last index
24. _________ in perl - An associative array
Assignment
print(FILEHANDLE "Data to outputn");
Hash variables
reverse(%hashName)
25. Add a new element to the from of the array with the value $newwValue
Scalar variables
unshift(@array, $newValue)
execution block
@ARGV
26. Does the hash key with "keyName" exists
execution block
exists($hashName{keyName})
sort(@array)
keys(%hash)
27. Removes trailing newline
Variable context
chomp($string)
delete($hashName{key})
like functions
28. Assignment of a hash variable for a single hash element
hash functions
exists($hashName{keyName})
$hashName{keyName}="Value to Add"
values(%hash)
29. Returns a copy of the string with the first letter lower case
Expression Quantifiers
@arrayName size
lcfirst($string)
last index
30. Returns all of the keys of the hash as an array
command substitution
keys(%hash)
%ENV hash array
$#arrayName
31. Returns a copy of the string as all lower case
lc($string)
foreach
Assignment
$#arrayName
32. 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
lc($string)
interpreter
similar data types
each(%hash)
33. _________ of scalar variables in perl - using "=" - Ex: $myVariable = 5;
Assignment
system commands
scalar context (Ex: $myArray[4] = 2)
lc($string)
34. ________ in perl - A collection of data (static data or scalar variables or arrays or hashes can all be stored in an array element)
push(@array, $newValue)
Array variables
join(':', @array)
$#arrayName
35. Returns a two element ray of the next key value pair; resultArray[0] is the key resultArray[1] is the value
each(%hash)
@entireFile=<FILEHANDLE>
execution block
Expression character classes
36. To read an entire file into an array (one line per element)
use moduleName; Ex: use Roman;
@entireFile=<FILEHANDLE>
foreach
hash functions
37. Split string into an array using spaces as delimeter
split(/\s/, $string)
flow-control
newline
basic binding operators
38. The four types of loops in perl: while - until - for - ________
Expression Quantifiers
Variable context
foreach
basic binding operators
39. _________ @arrayName) returns the size of the array
scalar
%hashname = (key1=>"value1", key2=>"value2", key3=>"Value3")
FILEHANDLE
string manipulation functions
40. 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
split(/\s/, $string)
$#arrayName
command substitution
Expression Quantifiers
41. The variable that provides the last index of an array
Editing
$#arrayName
last index
substr($string, $startindex, $numchars)
42. Arrays can be assigned or read in _________
scalar context (Ex: $myArray[4] = 2)
unshift(@array, $newValue)
$#arrayName
delete($hashName{key})
43. To include modules in perl
use moduleName; Ex: use Roman;
lc($string)
Expression Quantifiers
scalar context (Ex: $myArray[4] = 2)
44. The three basic ________ of the open() function: > write - >> append - < read file
each(%hash)
access modes
@entireFile=<FILEHANDLE>
@ARGV
45. scalar(@arrayName) returns the ______ of the array names
scalar
chomp(@string)
@arrayName size
use moduleName; Ex: use Roman;
46. To write to a filehandle
$#arrayName
$line=<FILEHANDLE>
print(FILEHANDLE "Data to outputn");
join(':', @array)
47. Common ________: pop(@array) - push(@array, $new Value) - shift(@array) - unshift(@array, $newValue) - sort(@array) - reverse(@array)
Hash variables
array functions
@entireFile=<FILEHANDLE>
reverse(%hashName)
48. Reverses the elements of the array
reverse(@array)
sort(@array)
reverse(%hashName)
foreach
49. A special system variable used to pass arguments to script
@ARGV
$#arrayName
comments
Editing
50. Remove trailing newline from each element in the array
access modes
reverse(@array)
(@array)
chomp(@string)
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