in reply to Re: Re: Where is my foreach data going to?
in thread Where is my foreach data going to?
results in the outputuse Data::Dumper; my @array = (1,2,3,4,5,6,7); print Dumper(\@array); my %hash; # below is a hash slice - you should learn about these @hash{@array} = @array;# a hash whose keys == its values print Dumper(\%hash);
which to my eyes seems nicer$VAR1 = [ 1, 2, 3, 4, 5, 6, 7 ]; $VAR1 = { '7' => 7, '1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6 };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Where is my foreach data going to?
by demerphq (Chancellor) on Sep 18, 2003 at 11:34 UTC |