Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Perl non-blocking IPC

by Somni (Friar)
on Jul 07, 2011 at 00:23 UTC ( [id://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 pondering the Monastery: (3)
As of 2024-04-26 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found