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