my @commands_run = (); #<-- moved foreach my $command1 (@commands){ 48 chomp $command1; 49 50 $command_run = $ssh->exec($command1); 51 52 print $command_run; 54 push (@commands_run, $command_run); -- want to push commands issued into the @commands_run array. 55 56 } 57 #print @commands_run;