use File::Remote qw(:replace); # read from a remote file open(REMOTE, "host:/remote/file") or die $!; print while (); close(REMOTE); # writing a local file still works! open(LOCAL, ">>/local/file"); print LOCAL "This is a new line.\n"; close(LOCAL); # Read and write whole files my @file = $remote->readfile("host:/remote/file"); $remote->writefile("/local/file", @file);