That line modifies @file (with pop) while looping through it with foreach.foreach (@file) { my $test = pop (@file); print $test; }
You should drop one of the statements for something better. I.e. change the foreach to while.
ps: print reverse <>; :-)
In reply to Re: Using Push and Pop.
by Joost
in thread Using Push and Pop.
by dark314
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |