my $socket = $ssh->socket; my $chan = $ssh->channel(); $chan->exec("/sbin/fwupdate -m\n"); close $socket; $ssh->disconnect;