![]() |
|
Perl Monk, Perl Meditation | |
PerlMonks |
Re^3: Perl non-blocking IPCby Somni (Friar) |
on Jul 07, 2011 at 00:23 UTC ( #913109=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|