in reply to removing the need for tmp files from script
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.
|
|---|