# build your ShellCmd obj - $shellcmd and the command to execute my $shellcmd = IPC::ShellCmd->new($mycommand_to_run); $shellcmd->chain_prog( IPC::ShellCmd::SSH->new( User => 'genericuser', Host => $myhost ) ); $shellcmd->run();