Help for this page

Select Code to Download


  1. or download this
    my $ref;
    
  2. or download this
    $ref->{key};
    %$ref->{key};
    %{$ref}->{key};
    $$ref{$key};
    
  3. or download this
    $ref->[0];
    @$ref->[0];
    @{$ref}->[0];
    $$ref[0];
    
  4. or download this
    $$ref = 1;
    $$ref;
    
  5. or download this
    my $ref = POLYMORPH->new( qw( key in some init values) );
    $ref->{key};  # might return 'in'
    $ref->[0];    # might return 'key'
    $ref;         # depends on implementation
    
  6. or download this
      How can I make a single reference that can be 
      LEGALLY DEREFERENCED as a hash ref, array ref, 
      AND a scalar ref, with the resulting operation 
      tied to a class implementation?