my $scp=Net::SCP->new( { host => 'the_real_host', user => 'the_real_user', interactive => 0, cwd => '/path/to/somewhere' } ); # ... (my $quoted=$_) =~ s/>/\\>/; if ( $scp->put($quoted) ) { # if ( $scp->put($_) ) { # etc