Could this be as simple as inserting
next unless scalar @goodlines;immediately before your print of @goodlines, because I think that ought to be the smallest change which achieves your goal. It would probably help your debugging if you were to use warnings too.
In reply to Re: Perl modifying output of an array to remove blank lines
by hippo
in thread Perl modifying output of an array to remove blank lines
by namelessjoe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |