push $item, $_ if /$pattern/;
Pushing to a scalar (which isn't an array ref) is an error. Just use an array instead. Same goes for your foreach postfix. Don't declare $item inside and outside the loop unless you intend them to be different variables. And maybe think about an alternative style of indenting? Good luck.
In reply to Re: removing the need for tmp files from script
by hippo
in thread removing the need for tmp files from script
by novice2015
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |