in reply to Re: Running blocks of shell script from within perl script
in thread Running blocks of shell script from within perl script
Using this mentality I've got this to work:
sub exec_check { my (%check) = @_; my $script = './fh.tmp'; open( my $out, '>', $script ); print $out $check{'CHECK_CODE'}; close($out); system("chmod 755 $script"); my @return = qx/$script/; foreach (@return) { my ($status, $string) = split(";", $_); print_output($status, $string); } system("rm $script"); }
It still seems a bit inelegant, but maybe with as with so many perl things it's just as elegant as it's going to get :\
|
|---|