PERL复习题
一、选择题 B
1. What is the simplest type of data that Perl can work with?
A element
B scalar
C vector
ponent
2. Which operator can be used to take the bottom item from an array?
A pop
B push
C pull
D plant
3. Which operator is used to arrange items in character order?
A ascend
B sort
C arrange
D descend
4. Rather than using print, what is often used in Perl when formatting is important?
A printf
B format
C align
D show
5. Which modifier can be used when matching in Perl to ignore case?
A s
B v
C i
D c
6. Which operator can be used to break up a string into more than one part based upon a
separator?
A chop
B split
C divide
D parse
7. What option do you use when starting Perl to tell it to run in warning mode? __________
(Fill in the blank.)
8. Which control structure can be used to execute only a condition is false?
A until
B unless
C while
D without
9. Which of the mands should be used to open a filehandle named KAREN to an
existing file named sw?
A open KAREN “>sw”; B open KAREN, “>sw”;
C open “sw” KAREN;
D open “>sw”, KAREN;
10. Within Perl, which operator is used to change the working directory?
A cd
B chdir
C pwd
D wd
11. Which operator can be used to access the first item in an array?
A shift
B start
C right$
D left$
12. Within a loop, which operator immediately ends execution of the loop?
A next
B last
C redo
D leave
13. Which function can be used to make sure your program exits with a nonzero status even if
there a standard error?
A hash
B noexit
C nozero
D die
14. Which of the following operators work most like simple searching/pattern matching?
A /f
B /g
C s///
D m//
15. Which keyword is used in Perl to define a subroutine?
A branch
B sub
C split
D make
16. You want to close the directory handle EVAN. Which of the following should you use to
plish this?
A close EVAN;
B closedir EVAN;
C close_dir
perl 期末考试题 来自淘豆网www.taodocs.com转载请标明出处.