http://www.perlmonks.org?node_id=1029870


in reply to Removing files from remote server

You can't pass ssh the name of a Perl subroutine from your script and expect it to be executed on the remote machine. It just doesn't work that way!

ssh can only run commands and shell statements.