my( $new_fh, $new)= mkstemp( '/var/tmp/generate_new.XXXXX' ); print {$new_fh} $req->content; close $new_fh; my $user= remote_user(); system( "export REMOTE_USER=$user; cat $new | $SCRIPT") # probably qualyfies as useless use of cat ;--) && exit_status( "problem running $SCRIPT: $!"); unlink( $new) or exit_status( "Warning: could not unlink temp file $new $!");