Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Feed ARGV into one-liner

by Krambambuli (Deacon)
on Jan 22, 2010 at 16:52 UTC ( #819000=note: print w/ replies, xml ) Need Help??

in reply to Feed ARGV into one-liner

A bit OT to your direct question, but just as an idea:

it's sometimes useful and easy to also use the shell as a helper.

You could write a shell script containing

perl -ne 'print $_ if /'$1'/' $2

which invoked as

./ Vet Test.txt

would also do what you asked for. As a side benefit, your oneliner is written down - just in the case you do not remember it well a week later when you need it again. :)


Comment on Re: Feed ARGV into one-liner
Replies are listed 'Best First'.
Re^2: Feed ARGV into one-liner
by Anonymous Monk on Jan 23, 2010 at 08:33 UTC
    cat >>oneliners.txt #frobnicates the fetzer valve perl -ne 'print $_ if /'$1'/' $2 ^D

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://819000]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2015-11-25 17:00 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (683 votes), past polls