#!/usr/bin/perl use IPC::Open3; use POSIX; $inputfile= $ARGV[0]; open(FILE, '<', "$ARGV[0]") or die $!; $command= "ssh user\@remotehost.com"; $pid = open3('<&FILE', '>&STDOUT', '>&STDERR', $command); $ret=waitpid( $pid, 0 );