in reply to use Net::SSH::perl to execute multiple commands

is it possible that each call of cmd uses a new instance of your shell? try doing it all in one big command

my $cmd = <<_COMMANDS_; export SYBASE="/usr/local/sybase/OC" export AUTOSYS="/usr/platinum/autosys" export AUTOUSER="/usr/platinum/autouser" export __std_err_file=/dev/null export __command=NIL export AUTO_JOB_PID=0 export AUTO_JOB_NAME="myjob" export APP_ROOT= autorep -q -J myjob#init#t _COMMANDS_ ... $ssh->cmd($cmd);

if nothing else it's easier on the eyes.