in reply to append an expression to a file on remote host

I think it could be something like (not tested):
use Net::SSH::Perl; my $host = 'host'; my $user = 'username'; my $pass = 'password'; my $string = 'Expression to append'; my $cmd = "echo $string >> /path/to/file"; my $ssh = Net::SSH::Perl->new($host); $ssh->login($user, $pass); my($stdout, $stderr, $exit) = $ssh->cmd($cmd);