Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
Do you know where your variables are?
 
PerlMonks  

Re: shell prob

by alpha (Scribe)
on Dec 27, 2006 at 10:44 UTC ( [id://591865]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to shell prob

You might try this: perl -e 'while (my $var = <STDIN>) {$run = "awk -f work_5messages.awk ".$var; `$run`;}'

Replies are listed 'Best First'.
Re^2: shell prob
by blazar (Canon) on Dec 27, 2006 at 11:47 UTC
    perl -e 'while (my $var = <STDIN>) {$run = "awk -f work_5messages.awk ".$var; `$run`;}'

    Apart that you don't need to create a temporary variable like that, and I don't see any particular advantage in doing so, any good reason to use backticks in void context?!? If you really want to stay minimal,

    chomp, system "awk -f work_5messages.awk $_" while <STDIN>;

    or (better)

    chomp, system qw/awk -f work_5messages.awk/, $_ while <STDIN>;

    But even better is to handle possible errors...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://591865]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.