#!/usr/bin/perl -w -T use Net::SSH::Expect; my $ssh = Net::SSH::Expect->new ( host => "", user => "", raw_pty => 1 ); $ssh->run_ssh() or die "SSH Process couldn't start: $!"; $ssh->exec("stty raw -echo"); my $who = $ssh->exec("whoami"); print ($who); my $scp = "scp \@:; $ssh->exec($scp) or die "SCP Process error: $!"; #### system('ssh \@ scp $file \@:');