Help for this page

Select Code to Download


  1. or download this
    my @array = qw /a b c d e f/;
    my $hash;
    my $val = 1;
    ($hash->{pop @array}, $val, $hash) = ($val, $hash, undef) while @array
    +;
    $hash = $val;
    
  2. or download this
    my @array = qw /a b c d e f/;
    my $hash = 1;
    my $tmp;
    
    ($tmp->{pop @array}, $hash, $tmp) = ($hash, $tmp, undef)  while @array
    +;