han_perl has asked for the wisdom of the Perl Monks concerning the following question:
The output1 should just be "this", not "this is this".============= Program ===================== @vol = ( "vol1", "vol2" ); $contextID = 9; $datastream = "this is just a data stream test"; ( $a, $b, $c, $d, $e, $f, $g ) = split /[\s]+/, $datastream; push @{test-$contextID-$vol[0]}, $a; push @{test-$contextID-$vol[0]}, $b; print "output0: @{test-$contextID-$vol[0]}\n"; push @{test-$contextID-$vol[1]}, $a; print "output1: @{test-$contextID-$vol[1]}\n"; ========= Output ===================== $ perl 1.pl output0: this is output1: this is this
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pushing a $variable into an array with varible name
by thor (Priest) on Jun 17, 2004 at 21:08 UTC | |
by Roy Johnson (Monsignor) on Jun 18, 2004 at 00:57 UTC | |
|
Re: pushing a $variable into an array with varible name
by davido (Cardinal) on Jun 18, 2004 at 00:34 UTC | |
|
Re: pushing a $variable into an array with varible name
by amw1 (Friar) on Jun 17, 2004 at 21:08 UTC | |
|
Re: pushing a $variable into an array with varible name
by Ido (Hermit) on Jun 18, 2004 at 00:15 UTC |