my @args = map{ ($_, foo($arg{$_})) } keys %args; my @output = `/bin/foo @args`; #### system( '/bin/foo -p stuff' ); # passes by the shell system( '/bin/foo', '-p', 'stuff' ); # bypasses the shell #### my @out = `/bin/foo`, qw/-p stuff/; #### my $pid; if( !defined($pid = open( KIDP, '-|' ))) { print child fork error: $!\n"; } elsif( $pid ) { while( ) { chomp; # digest $_ } close KID; } else { $ENV{PATH} = '/bin:/usr/bin:/usr/local/bin'; my @args = map{ (foo, foo($_)) } keys %data; exec '/usr/local/bin/check-netscreen', @args; die "ping child died \$!=$! \$@=$@\nargs = @args"; } #### #! /usr/bin/perl -w use strict; my @out = readpipe( '/bin/foo', qw/one two three/ );