while (my $packet = Net::SSH::Perl::Packet->read_poll($ssh)) { if (my $code = $h->{ $packet->type }) { $ssh->debug("Info - packet type: " . $packet->type); $code->($cmgr, $packet); } else { $ssh->debug("Warning: ignore packet type " . $packet->type); } } last if $ssh->_quit_pending;