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