in reply to shorter 1 liner way of doing this

grep { $array[$_] =~ /xxx/ } 0 .. $#array;
why are you so obsessed with one liners

Replies are listed 'Best First'.
Re^2: shorter 1 liner way of doing this
by theleftright (Novice) on Dec 27, 2015 at 21:40 UTC
    smaller code and it's one of perls many strong points and for whatever reason people are obsessed with perl golf and quines and 1 liners and perl poems and ..ect..

      You have to program to play Perl golf, etc., but Perl golf, etc., is not programming. It doesn't really matter what you do, just don't do it in the machine room and frighten the hardware.

      Value clarity over concision.


      Give a man a fish:  <%-{-{-{-<

      Obsessed? Nay, sir. I despise Perl “poetry” and as Clemens observed golf is a good walk spoiled and quines are for Aussie professors!