Help for this page

Select Code to Download


  1. or download this
    use strict; #for better practice
    use warnings;#same as above
    ...
    $bits{'one'}= \@test;#assign the array ref, not the flattened array it
    +self.
    my @new =  @{$bits{'one'}};#now deref it, so you get the flattened arr
    +ay back.
    print '['.$new[2].'] ['.$new[1].'] ['.$new[0]."]\n";
    
  2. or download this
    use strict;
    use warnings;
    ...
    $bits{'one'}= \@test;
    my $new =  $bits{'one'}; #new holds the array ref, not a copy of the e
    +ntire array
    print '['.$new->[2].'] ['.$new->[1].'] ['.$new->[0]."]\n";#to get elem
    +ents from array ref, use -> operator