June 2005
Beginner
480 pages
10h 31m
English
| 1: | Variables are interpolated inside qq quotes.
|
| 2: | What value is stored in $c after running the following code?
$a=6; $a++; $b=$a; $b--; $c=$b;
|
| 3: | Concatenation can be performed only with the concatenation operator (.).
|
| A1: | a. True. qq behaves in every way like a pair of double quotation marks. This means it can interpolate variables. |
| A2: | a. $a is set to 6. $a is then incremented to 7, and assigned to $b. $b is decremented to 6, and assigned to $c. |
| A3: | b. False. A motto in the Perl community is “There Is More Than One Way To Do It” (TIMTOWTDI). Concatenation can be performed by including two (or more) scalars in a double-quoted string, as follows:
qq($a$b$c); |
Write a short program that prompts ...
Read now
Unlock full access