Help for this page

Select Code to Download


  1. or download this
    my %hash;
    my @array = (1..100);
    
    # this will be ok
    $hash{\@array} = 42;
    
  2. or download this
    my %hash;
    my @array = (1..100);
    ...
    # but this will issue an error, because \@array 
    # cannot be used as a key which varies
    $hash{\@array}{1} = 42;
    
  3. or download this
    use strict;
    
    ...
    my @array = (1..100);
    $hash{\@array} = {};
    $hash{\@array}{1} = 42;