Perl Basics   «Prev  Next»

Perl Array References - Quiz

Each question is worth one point. Select the best answer for each question.
 
1. Given this code fragment, answer the questions below:
$fooref = [ 'foo', 'bar', 'baz' ];
$arrayref = [ 'one', 'two', [ 'a', 'b', $fooref ], 'four' ];
How would you get the value 'b' from $arrayref?
Please select the best answer.
  A. arrayref->[2][1]
  B. #arrayref->[1]
  C. $$arrayref[2][1]

2. The $arrayref->[2] is an anonymous array:
Please select the best answer.
  A. true  
  B. false 
  C. Maybe

3. What value would this expression return?
$arrayref->[2][2][2]
Please select the best answer.
  A. 'baz'
  B. 'bar'
  C. 'foo'

Your score is 0.0