1. : What do we use to test whether Perl is in your PATH?
(A) perl -el
(B) perl -i
(C) perl -e
(D) perl -ed
2. : Which function is used to delete the elements from the right of the array?
(A) queue
(B) push
(C) pop
(D) shift
3. : Perl is what of the grep, tr, sed and awk?
(A) subset
(B) child
(C) superset
(D) parent
4. : What is used to loop in a list?
(A) for
(B) fordo
(C) foreach
(D) while
5. : With what extension is it convenient to save Perl program files?
(A) .gp
(B) .pl
(C) .awk
(D) .sh
6. : Which function do we use to remove the last character from a line?
(A) chop
(B) cut
(C) erase
(D) split
7. : To identify a word character, the escape character used is_______
(A) \s
(B) \w
(C) \d
(D) \n
8. : The Perl variables don’t have any types and any initializations.
(A) False
(B) True
Answer: (B) True
9. : What is the most powerful filter?
(A) Perl
(B) grep
(C) sed
(D) awk
10. : To handle the substitutions in Perl, we use___________
(A) tr
(B) tr and s
(C) str
(D) s
11. : Which of the following functions returns the first occurrence of the character in the string?
(A) string
(B) length
(C) split
(D) index
12. : Which function do we use for extracting a substring?
(A) string
(B) index
(C) length
(D) substr
13. : Which operator does Perl use to repeat a string?
(A) x
(B) .
(C) /
(D) \
14. : To display the length of a string, Perl uses what function?
(A) string
(B) length
(C) split
(D) len
15. : To reverse a string, Perl uses which function?
(A) reverse
(B) rev
(C) split
(D) substr
16. : When we use string for numeral computations, Perl converts it into what?
(A) number
(B) floating point number
(C) character
(D) boolean value
17. : What is the value of an undefined variable?
(A) garbage
(B) 1
(C) NULL
(D) 0
18. : Concatenation operators are______________
(A) /
(B) _
(C) .
(D) \
19. : What is used to split the line or expression into fields?
(A) foreach
(B) for
(C) join
(D) split
20. : What is referred to as the default variable?
(A) $0
(B) $-+*
(C) $!
(D) $1
21. : To select current line number which operator can be used?
(A) $.
(B) $1
(C) $0
(D) $_
22. : What is the range operator?
(A) $.
(B) $1
(C) ..
(D) $_
23. : First ten integer values to the array @x=(1..10) are assigned by this command.
(A) False
(B) True
Answer: (B) True
24. : Last index of the array is signified by which prefix to the array name?
(A) $0
(B) $_
(C) #$
(D) $#
25. : Which function is used for adding elements to the left side of the array?
(A) pop
(B) unshift
(C) queue
(D) push
26. : Which function is used for adding elements to the right side of the array?
(A) pop
(B) queue
(C) push
(D) unshift
27. : perl -e ‘print “UNIX” x 10 . “\n”;’ — This displays:
(A) UNIX
(B) error message
(C) UNIX 10 times
(D) \n
28. : Functionalities of push, pop, unshift and shift are combined by which function?
(A) add
(B) splice
(C) delete
(D) split
29. : Which function is used to join lists?
(A) join
(B) for
(C) split
(D) foreach
30. : Which function is used to delete the elements from the left of the array?
(A) shift
(B) push
(C) queue
(D) pop