while (1) { warn "Waiting for PDU"; $pdu = $smpp->read_pdu() or die "$$: PDU not read. Closing connection"; print "Received #$pdu->{seq} $pdu->{cmd}:". Net::SMPP::pdu_tab->{$pdu->{cmd}}{cmd} ."\n" ; warn Dumper($pdu) if $trace; if (defined reply_tab->{$pdu->{cmd}}) { &{reply_tab->{$pdu->{cmd}}{reply}}($c, $pdu); warn "Replied"; } else { warn "Don't know to reply to $pdu->{cmd}"; sleep 1; } }