in reply to exec vs. backtick-and-assign performance
If you want the command's STDOUT then try using open like:
my $output = do { open my $fh, '-|', '/etc/init.d/networking', 'restart' or die "Can +not open pipe from '/etc/init.d/networking' $!"; local $/; <$fh> };
|
|---|