use File::Which qw(which); $tshark_binary = which('tshark'); $tshark_binary =~ s/\\/\\\\/g if $tshark_binary =~ /\\/; #### system("\"$tshark_binary\" -r $pcap -e frame.number -e frame.time_epoch -e ip.src -e ip.id -T text -T fields -E separator=, > $temp_file");