If $string contains abcdefgh , what will the following call return?
substr($string, -2, 2);
abc
efgh
gh
If $string contains abcdabcd , what will the following call return? index ($string, “cd”, 3);
6
4
-1
2
Which operator can be used to access the first item in an array?
shift
start
right$
left$
Assume that $var has the value hello . What is the value of the following sting?qq(It’s time to say $var);
It’s time to say $var
It’s time to say hello
Both
None
Which modifier can be used when matching in Perl to match any character?
S
V
I
C
Which of the following operators work most like substitution?
/f
/g
s///
m//
Running your Perl scripts with a d switch will perform which task?
Invoke the Perl debugger
Disable the Perl debugger
Disable breakpoints
Display a stack trace
Which file test can be done to see if a file is a socket?
-s
-l
-S
-k
How can you include code from another file in your program?
With the #include preprocessor command
Adding the file’s directory to @INC and then passing the filename to require.
Both A & B
What will the following statement return?
grep(! /^ !/, @array);
Every non empty list element
Every list element that does not start with an exclamation mark.
Every list element.