and it will work - given that there were no undef elements in the array that you want to keep@last_n = grep { defined($_) } @last_n;
In reply to Re: What’s the best way to get the last N elements of a Perl array?
by svenXY
in thread What’s the best way to get the last N elements of a Perl array?
by vinoth.ree
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |