Perl Basics   «Prev  Next»

Perl References - Quiz

1. A Perl reference is:
Please select the best answer.
  A. Limited to two-dimensional data
  B. the contents of a variable
  C. a scalar variable that points to another object

2. A dereference is:
Please select the best answer.
  A. A reference to an object in Perl.
  B. An object being accessed via a reference.
  C. A scalar variable being accessed via an object.

3. An anonymous object is:
Please select the best answer.
  A. an element of the dereferenced array
  B. an object without a name
  C. a special arrow operator

4. Refer to this code fragment to answer the following questions: $var1 = "George"; $var2 = \$var1; $var3 = $var2; $var4 = $$var2; $var5 = $$var3; Which variables are references?
Please select the best answer.
  A. $var2 and $var3
  B. $var1
  C. $var5 and $var1

5. What are they references to?
Please select the best answer.
  A. $var1
  B. George
  D. used to aggregate data into smaller dimensions

6. What is the content of $var4?
Please select the best answer.
  A. \$var1
  B. "George"
  C. $var2

7. What is the content of $var5?
Please select the best answer.
  A. $var2
  B. \$var1
  C. "George"