my $output = `PATH=$ENV{PATH} command arg1 arg2 argn`; #### my $output = `setenv PATH "$ENV{PATH}"; command arg1 arg2 argn`; #### my ($cp) = grep { -x $_ } map { "$_/cp" } grep { length $_ } split /:/, $ENV{PATH}; die "cant find cp" unless defined $cp; my $output = `$cp source dest`;
## my $output = `setenv PATH "$ENV{PATH}"; command arg1 arg2 argn`; ##
## my ($cp) = grep { -x $_ } map { "$_/cp" } grep { length $_ } split /:/, $ENV{PATH}; die "cant find cp" unless defined $cp; my $output = `$cp source dest`;