in reply to Re: Hash of refs to refs
in thread Hash of refs to refs
Or, if I really wanted to use the hashtable:my @samples = ( [ [ 1, 2, 3, 4 ], [ 5, 6, 7, 8 ] ], [ [ 1, 3, 5, 7 ], [ 2, 4, 6, 8 ] ] ); my $sample; foreach $sample (@samples) { my @set = @$sample; my @in = @{$set[0]}; my @out = @{$set[1]}; print "in: @in out: @out\n"; }
my %samples = ( 'a' => [ [1, 2, 3, 4], [5, 6, 7, 8] ], 'b' => [ [1, 3, 5, 7], [2, 4, 6, 8] ] ); my $key; foreach $key (keys %samples) { my @set = @{$samples{$key}}; my @in = @{$set[0]}; my @out = @{$set[1]}; print "in: @in out: @out\n"; }
The second method allows me to label my samples.
How nice!
Thanks again.
Rob
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) 3Re: Hash of refs to refs
by jeffa (Bishop) on Dec 01, 2001 at 20:24 UTC |