172

References & Structures
References to Anonymous Values

  • References may point to anonymous lists by using the [ ] delimiters as a list constructor

      $myListReference = [ 1, 2, [ 'a', 'b', 'c' ] ];
      print $$myListReference[1], "\n";
      print @{$$myListReference[2]}, "\n";

  • References may point to anonymous associative arrays by using the { } delimiters and the => operator

      $myHashReference = { 'a' => "ape", 'b' => "bat" };
      print $$myHashReference{'a'}, "\n";