PERL复习题
一、选择题 B
1. What is the simplest type of data that Perl can work with?
A element
B scalar
C vector
D component
2. Which operator can be ud to take the bottom item from an array?
A pop
B push
C pull
D plant
3. Which operator is ud to arrange items in character order?
A ascend
B sort
C arrange
D descend
4. Rather than using print, what is often ud in Perl when formatting is important?
A printf
B format
C align
D show
5. Which modifier can be ud when matching in Perl to ignore ca?
A s
B v
C i
D c
6. Which operator can be ud to break up a string into more than one part bad upon a
parator?
A chop
B split
C divide
D par
7. What option do you u when starting Perl to tell it to run in warning mode? __________
(Fill in the blank.)
8. Which control structure can be ud to execute only a condition is fal?
A until
B unless
C while
D without
9. Which of the following commands should be ud 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 ud to change the working directory?
A cd
B chdir
C pwd
D wd
chee什么意思11. Which operator can be ud to access the first item in an array?
mobile me西安android培训A shift
B start
C right$
D left$
12. Within a loop, which operator immediately ends execution of the loop?
A next
occasionB last
C redo
D leave
13. Which function can be ud to make sure your program exits with a nonzero status even if
there a standard error?
A hash
B noexit
temporarily
C nozero
D die
14. Which of the following operators work most like simple arching/pattern matching?
A /f
B /g
狗血淋头C s///
D m//
15. Which keyword is ud in Perl to define a subroutine?
A branch
B sub
C split
D make
16. You want to clo the directory handle EVAN. Which of the following should you u to
accomplish this?
A clo EVAN;
B clodir EVAN;
C clo_directory EVAN;
D none of the above
17. Which of the following lines of code accomplishes the same thing as $price = $price + 9;?
A $price +9;
B $price =+9;
C $price +=9; D 9 + $price
不公平英语
18. What value do variables have before they are first assigned?
A undef
B null
C 0
D nil
19. Which Perl function can be ud to launch a child process to run a program?
A split
zzia
B spin
C fork
D system
20. Which Perl function can be ud to identify the first found occurrence of a substring?
A find
B index
C locate
D allocate
21. Which control structure can be ud to loop as long as a conditional expression returns true?
A until
B unless
C while
D without
22. Which operator can be ud to create private variables within a subroutine?
A native
B limited
C my
D regional
23. Which of the following operators is ud to return a value in a subroutine?
A return
B nd
C give
D show 英文资料翻译
24. Your script has just read in a variable from the keyboard and you want to strip that variable of
the newline character that came in. What operator should you u to perform this operation?
A tidy
B trim
C chomp
D slim
25. What is the default sort order in Perl?
A alphabetic
B numeric
C ASCII
D none of the above
26. Within a loop, which operator jumps to the end of the loop but does not exit the loop?
A next B last
C redo
D leave
27. Which of the following should be ud to print values in an array that do not contain
newlines and add them to the end of each entry?
A print @array;
B print @array\n;
smn是什么意思
C print “@array\n”;
D print “$@array \\”;
28. Which string comparison operator would be equivalent to the numeric > operator?
A ne
B eq
C ge
D gt
29. Which function can be thought of as the opposite of split?
A link
B join
C unite
D bond
30. Which operator can be ud to add an item to the bottom of an array?
A pop