Disable strict mode and use bare filehandles File::Remote is too old to handle "my" variables. And then configure it to use ssh/scp as shown below:
use strict;
use warnings;
use File::Remote;
{
no strict;
my $remote = new File::Remote (rsh => "/usr/bin/ssh", rcp => "/usr
+/bin/scp");
$remote->open(FILE, '>>biz:/tmp/weeeee') or die $!;
print FILE "Here's a line that's added.\n";
$remote->close(FILE);
}
If you need to specify a non standard port, it's best to do it in your ssh config. For instance to configure the biz server used above for a different port:
mkdir ~/.ssh
echo "Host biz\nPort 888\n" >> ~/.ssh/config
chmod go= ~/.ssh ~/.ssh/config
HTH..
|