in reply to Running blocks of shell script from within perl script

If you want/need to avoid temporary files, you can use open2 to run the shell (or other program), pipe the script to it and pipe the output back:

use FileHandle; use IPC::Open2; my ($shell, script) = split("\n", $data{'CHECK_CODE'}, 2); $shell =~ s/^#!\s*//; open2(RH, SH, $shell); print SH $script . "\n"; close SH; # is this the right place for this? my @out = <RH>; close RH;