in reply to perl grep clone

23:

# 5 0 5 0 3 print grep/$ARGV[0]/,<>;

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: perl grep clone
by pythondude (Initiate) on Apr 01, 2016 at 22:20 UTC

    This dosen't work for me because perl tries to interpret the pattern as a file name, but I found it does not use this behavior when using <STDIN> instead of <>.

    29:

    # 5 0 5 0 5 9 print grep/$ARGV[0]/,<STDIN>;
      I cheat a little and assume only one argument on the command line:
      print grep/@ARGV/,<STDIN>;