I don't get to excited about using fewer operators. I let map() work on the data and grep() pick out which elements it wants.
my @lines = grep length(), map { s/#.*//; s/^\s+|\s+$//g; $_ } <$in>;
Update japhy's right that that s/// with the alternation is slow. It's even in the perlfaq, and I know that because I updated that answer recently. That's what I get for golfing the line to not break with the code formatter thinger. :)
In reply to Re: A perverse use of grep
by brian_d_foy
in thread A perverse use of grep
by eyepopslikeamosquito
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |