Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Perl non-blocking IPC

by Somni (Friar)
on Jul 07, 2011 at 00:23 UTC ( #913109=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl non-blocking IPC
in thread Perl non-blocking IPC

It's been a while since I've seen actual FileHandle usage. You don't need it; assuming you're using a perl newer than 5.00505:

open(my $fh, '-|', qw( tail -f -n command_file)) || die("Unable to run tail: $!.\n");

You can pass a single string, but whenever possible, call system(), open(), etc. with a list for the command; it's safer, because you're guaranteed not to get filtered through /bin/sh.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2023-12-11 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (41 votes). Check out past polls.

    Notices?