From: Dobrica Pavlinusic Date: Fri, 22 Feb 2019 08:51:16 +0000 (+0100) Subject: ask for response on unknown X-Git-Url: http://git.rot13.org/?p=safeq;a=commitdiff_plain;h=4262030d6d2559c6ce7d1e4e6edf1e6828acd4ee ask for response on unknown --- diff --git a/terminal-emulator.pl b/terminal-emulator.pl index 9a4b485..781d353 100755 --- a/terminal-emulator.pl +++ b/terminal-emulator.pl @@ -34,22 +34,21 @@ my @send_receive = grep { /^.+$/ } split(/\n/, q{ .ACTION CMENUS0 .NOP -.NOP - +.NOP .NOP -.NOP +.NOP .NOP -.NOP +.NOP .NOP -.NOP +.NOP .NOP .NOP -.END +.END }); #warn "# send_receive=",dump( \@send_receive ); @@ -61,9 +60,15 @@ while ( @send_receive ) { print $socket "$send\r\n"; my $got = <$socket>; $got =~ s/[\r\n]+$//; -warn dump($send,$expect,$got); +warn "# send/expect/got ",dump($send,$expect,$got); warn "<< $got\n"; - die "ERROR expected [$expect] got [$got]" if $expect ne $got; + if ( $expect ne $got ) { + warn "ERROR expected [$expect] got [$got]\n"; + print "Response>"; + my $r = ; chomp $r; + print $socket "$r\r\n"; + } + } $socket->close();