Help for this page

Select Code to Download


  1. or download this
    $hash{$id} = [1,2,3]; # [ ... ] creates an anonymous array ref
    @temp = (1,2,3);
    $hash{$id} = \@temp; # \ makes an explicit reference to @temp
    
  2. or download this
    $x = ${$hash{$id}}[0];
    # or
    $x = $hash{$id}[0];
    # or
    $x = $hash{$id}->[0];
    
  3. or download this
    my @values = @{$hash{$id}};