my @problems = (1,2,3); for my $problem (@problems) { push @problems, $problem if $problem; }
That should probably be written as:
my @problems = ( 1, 2, 3 ); push @problems, grep $_, @problems;
In reply to Re: push in for loop
by jwkrahn
in thread push in for loop
by Sewi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |