Tutor Marked Assignment PL TMA-11
In a Nutshell - CIW Course Section 2 Part B
PL TMA-11 - CD Access Code: 29175
Q1. One method of debugging is to use the print command at different intervals throughout the script. The positions where the print commands are used in this way are known as what?
- a) Trigger-points
- b) Markers
- c) Breakpoints
- d) Checkpoints
Q2. Which switch is used to enable the code warning system in Perl?
- a) -v
- b) -V
- c) -w
- d) -W
Q3. The strict module requires that you declare references, variables and bare word identifiers. To do this you can use either the ________ function, the ________ vars pragma, or a fully ________ variable.
- a) strict, my, qualified
- b) my, strict, qualified
- c) qualified, my, strict
- d) my, qualified, strict
Q4. The Perl debugger can be used to troubleshoot compile-time errors.
- a) True
- b) False
Q5. Match the Perl debugger commands to the corresponding description of their function.
- a) d
- b) b
- c) D
- d) L
- e) c
- f) P
- g) s
- h) l (small L)
- i) T
- 1) Show all currently set breakpoints and actions
- 2) Display the result of an evaluated expression on the screen
- 3) Execute lines in a script one at a time
- 4) Show the next page of lines in the current script from the current line
- 5) Execute all remaining lines in the script until breakpoint or end of script is reached
- 6) Remove the breakpoint from the current execution line
- 7) Displays a stack trace
- 8) Remove all breakpoints
- 9) Creates a breakpoint in the current execution line
Q6. The semicolon does not serve as a statement terminator in Perl. A return must be placed at the end of all Perl statements to mark their termination
- a) True
- b) False
Q7. Which of the following are good-practice guidelines relating to the use of spacing in Perl scripts?
- a) Break long lines before an operator, but after and, and or.
- b) Put a space after each comma
- c) Surround most operators with space
- d) Do not put a new line between a closing brace and else
- e) Put a space between a function name and its opening parentesis
- f) Put a space before the opening brace of a multi-line BLOCK.
Q8. Aside from package names, it can be useful to use the ________ character to separate words within the names of variables, functions, etc.
- a) space
- b) tab
- c) underscore
- d) dollar
Q9. When using the 'strict' pragma, which items can Perl enforce strict rules about?
- a) vars
- b) tags
- c) links
- d) subs
- e) refs
- f) labels
Q10. What would be the correct syntax to run the Perl debugger on a script named 'pro1.pl'?
- a) perl prog1.pl -d
- b) perl prog1.pl -D
- c) perl -d prog1.pl
- d) perl -D prog1.pl

