in reply to ssh trouble

I have no idea what your problem might be, but a quick look at the docs for Net::SSH::Perl reveals that you might be able to get more information about why it is failing:
my ($out, $err, $exit) = $ssh->cmd("perl getEnvs.pl"); print "exit: $exit\n"; print "error: $err\n"; print "output: $out\n";

Tip #11 from Basic debugging checklist

Replies are listed 'Best First'.
Re^2: ssh trouble
by rgb96 (Acolyte) on Mar 10, 2009 at 18:59 UTC

    okay,thanks. I tried that and got an output of "2". any idea what that means?

      2 is the code for POSIX error ENOENT - file not found - see Error.

      A user level that continues to overstate my experience :-))
        I see that, but the file is there... I am confused.
      No idea. I updated my node. You should print out all 3 pieces of information (out, err, exit). What do you expect them to be? When you run your getEnvs.pl script, what do you expect its output to be? You probably expect its exit status to be 0, right? Also, does your "cd AATv2" command succeed?

        It seems that the cd is working, and I noticed $err is printing out "Can't open perl script "getEnvs.pl": No such file or directory." which is weird, because I know for a fact that it is there. I can manually create an ssh session, and copy and paste those same commands from my script to my ssh, and they work fine. I tried being more specific with the cd path, but that didn't seem to make a difference either.