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 = ; close RH;