Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: portability / system / elegance

by ikegami (Patriarch)
on Dec 05, 2016 at 01:40 UTC ( #1177186=note: print w/replies, xml ) Need Help??


in reply to portability / system / elegance

Avoid the shell. In addition to the usual benefits, this problem goes away.

You should use IPC::Run3 or IPC::Run, but low-level IPC::Open3 will be easy enough to use here.

use File::Spec::Functions qw( devnull ); use IPC::Open3 qw( open3 ); { my @cmd = ( $tshark_binary => ( -r => $pcap, -e => "frame.number", -e => "frame.time_epoch", -e => "ip.src", -e => "ip.id", -T => "text", -T => "fields", -E => "separator=," ), ); open(local *CHILD_STDIN, '<', devnull) or die $!; open(local *CHILD_STDOUT, '>', $file_temp) or die $!; my $pid = open3('<&CHILD_STDIN', '>&CHILD_STDOUT', '>&STDERR', @cmd); waitpid($pid, 0); }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2022-05-28 20:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (101 votes). Check out past polls.

    Notices?