in reply to Suppress STDOUT of a called program
use strict; use warnings; my $nmapCmd = q{/path/to/nmap -and -any -args}; open my $nmapFH, q{-|}, $nmapCmd or die qq{fork: $nmapCmd: $!\n}; while ( <$nmapFH> ) { chomp; # Do something with nmap output here ... print qq{Sanitised stuff for user\n}; } close $nmapFH or die qq{close: $nmapCmd: $!\n};
I hope this is of use.
Cheers,
JohnGG
|
|---|