in reply to pushing a $variable into an array with varible name
@vol = ( "vol1", "vol2" ); $contextID = 9; $datastream = "this is just a data stream test"; ( $a, $b, $c, $d, $e, $f, $g ) = split /\s+/, $datastream; my %hash; $"=" "; #see 'perldoc perlvar' for what this means push @{$hash{"$contextID-$vol[0]"}}, $a; push @{$hash{"$contextID-$vol[0]"}}, $b; print "output0: @{$hash{"$contextID-$vol[0]"}}\n"; push @{$hash{"$contextID-$vol[1]"}}, $a; print "output1: @{{"$contextID-$vol[1]"}}\n";
thor
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: pushing a $variable into an array with varible name
by Roy Johnson (Monsignor) on Jun 18, 2004 at 00:57 UTC |