I suggest to do this with File::Remote instead. It supports ssh/scp and you can then copy over existing files.
Some code:
use File::Remote;
my $remote = new File::Remote(rsh => "/usr/bin/ssh",
rcp => "/usr/bin/scp"
);
$remote->copy("/local/file", "host:/remote/file") or warn $!;