in reply to push in for loop
You can accomplish whatever it is you are desiring by using array indices instead:
my @problems = (1,2,3); for my $i (0 .. $#problems) { push @problems, $problems[$i] if $problems[$i]; } print for @problems;
Care to explain what it is you are trying to accomplish? :)
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: push in for loop
by NetWallah (Canon) on Dec 12, 2011 at 21:51 UTC | |
Re^2: push in for loop
by Sewi (Friar) on Dec 12, 2011 at 17:28 UTC | |
by jeffa (Bishop) on Dec 12, 2011 at 17:32 UTC |
In Section
Seekers of Perl Wisdom