1. What is the simplest type of data that Perl can work with? 1. element 2. scalar 3. vector 4. component 2. Which operator can be used to take the bottom item from an array? 1. pop 2. push 3. pull 4. plant 3. Which operator is used to arrange items in character order? 1. ascend 2. sort 3. arrange 4. descend 4. Rather than using print, what is often used in Perl when formatting is important? 1. printf 2. format 3. align 4. show 5. Which modifier can be used when matching in Perl to ignore case? 1. s 2. v 3. i 4. c 6. Which operator can be used to break up a string into more than one part based upon a separator? 1. chop 2. split 3. divide 4. 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? 1. until 2. unless 3. while 4. without 9. Which of the following commands should be used to open a filehandle named KAREN to an existing file named sw? 1. open KAREN ">sw"; 2. open KAREN, ">sw"; 3. open "sw" KAREN; 4. open ">sw", KAREN; 10. Which file test can be done to see if a file has the sticky bit set on it? 1. -s 2. -l 3. -S 4. -k 11. Within Perl, which operator is used to change the working directory? 1. cd 2. chdir 3. pwd 4. wd 12. Which operator can be used to access the first item in an array? 1. shift 2. start 3. right$ 4. left$ 13. Within a loop, which operator immediately ends execution of the loop? 1. next 2. last 3. redo 4. leave 14. Which function can be used to make sure your program exits with a nonzero status even if there a standard error? 1. hash 2. noexit 3. nozero 4. die 15. Which of the following operators work most like simple searching/pattern matching? 1. /f 2. /g 3. s/// 4. m// 16. Which keyword is used in Perl to define a subroutine? 1. branch 2. sub 3. split 4. make 17. You want to close the directory handle EVAN. Which of the following should you use to accomplish this? 1. close EVAN; 2. closedir EVAN; 3. close_directory EVAN; 4. none of the above 18. Which of the following lines of code accomplishes the same thing as $price = $price + 9;? 1. $price +9; 2. $price =+9; 3. $price +=9; 4. 9 + $price 19. Which Perl operator works the same as the Linux rm command? 1. rm 2. del 3. unlink 4. bye 5. 6 6. 7 20. Which function can be used to return such information about a file as its UID, GID, CTIME, etc.? 1. file 2. stat 3. info 4. mode 2 You want your script to read in a value from the keyboard for a variable named $duo. What do you set $duo equal to in the program to have it read a keyboard value? __________ (Fill in the blank.) 21. Which file test can be done to see if a file exists and has a nonzero size? 1. -s 2. -l 3. -S 4. -k 22. Which Perl function is used to change the name of a file? 1. nameas 2. rename 3. name 4. now_known_as 23. What value do variables have before they are first assigned? 1. undef 2. null 3. 0 4. nil 24. Which Perl function can be used to launch a child process to run a program? 1. split 2. spin 3. fork 4. system 25. Which Perl function can be used to identify the first found occurrence of a substring? 1. find 2. index 3. locate 4. allocate 26. Which control structure can be used to loop as long as a conditional expression returns true? 1. until 2. unless 3. while 4. without 27. Which operator can be used to create private variables within a subroutine? 1. native 2. limited 3. my 4. regional 29. What Perl function is identical to printf only instead of printing a string, it just returns it and can thus be useful in storing it in a variable? __________ (Fill in the blank.) 30. Which file test can be done to see if a file is a symbolic link? 1. -s 2. -l 3. -S 4. -k 31. Within a loop, which operator jumps to the beginning of the loop but does not exit the loop? 1. next 2. last 3. redo 4. leave 32. Which of the following operators is used to return a value in a subroutine? 1. return 2. send 3. give 4. show 33. 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 use to perform this operation? 1. tidy 2. trim 3. chomp 4. slim 34. To convert a timestamp into a format more readable by a user, which function should you use? 1. bitwise 2. localtime 3. translate 4. transform 35. What is the default sort order in Perl? 1. alphabetic 2. numeric 3. ASCII 4. none of the above 36. Which file test can be done to see if a file is a socket? 1. -s 2. -l 3. -S 4. -k 37. Which function can be used to print a message to standard error, but not quit the program? 1. warn 2. alert 3. tell 4. notifiy 38. Which command should be used to close the filehandle KAREN? 1. close KAREN "sw"; 2. KAREN close; 3. close KAREN; 4. close &KAREN 39. Which operator is the opposite of shift? 1. replace 2. restart 3. unshift 4. return 40. Within a loop, which operator jumps to the end of the loop but does not exit the loop? 1. next 2. last 3. redo 4. leave 41. Which of the following should be used to print values in an array that do not contain newlines and add them to the end of each entry? 1. print @array; 2. print @array\n; 3. print "@array\n"; 4. print "$@array \\"; 42. Which string comparison operator would be equivalent to the numeric > operator? 1. ne 2. eq 3. ge 4. gt 43. Which control structure can be used to loop as long as a conditional expression returns false? 1. until 2. unless 3. while 4. without 44. Which function can be thought of as the opposite of split? 1. link 2. join 3. unite 4. bond 45. Which of the following operators work most like substitution? 1. /f 2. /g 3. s/// 4. m// 46. Which modifier can be used when matching in Perl to match any character? 1. s 2. v 3. i 4. c 47. Which of the following will call a subroutine named "mom"? 1. &mom 2. $mom 3. mom$ 4. %mom% 48. Which type of loop can be used to step through each value in a list? 1. conv 2. one_by_one 3. separate 4. foreach 49. Which operator can be used to add an item to the bottom of an array? 1. pop 2. push 3. pull 4. plant 50. Which of the following mathematical operations has the highest precedence in Perl? 1. ** 2. ++ 3. + 4. -