kc2rgw has asked for the wisdom of the Perl Monks concerning the following question:
Thanks to Botje on freenode #perl...this is FIXED!!
Apparently inetd is using block buffering....so the fix was simply
$| = 1;
I would have never known about this issue....this cost me hours and hours
Thanks Botje! and hope this helps someone else out
One additional note....that is deprecated and the proper form is
STDOUT->autoflush;
This is a snippet from a longer app.
The app, when run in a shell works 100% as expected.
It asks for input from a user, validates, and submits to an online service to look up the data that was entered and return a listing.
The app is run from inetd and the interface to the app is a telnet session.
This is for a packet radio node, to look up ham call signs, thus the arcane inetd/telnet interface.
When run via telnet and inetd, invalid entries return immediately to the prompt. a 'q' to quit, immediately exits, but with a valid call sign, it just sits and I have to hit <enter> one more time...then it responds completely normally.
Outside this block I have to set TERM=dumb or I get no display at all via telnet. I also have to do term resets as is shown in this snippet, in two other places or I get no display via the telnet session.
In the shell, none of that term mangling is needed
while ($seskey) { print "Callsign? or q: \n"; ( my $call = <STDIN> ); $call =~ s/[^a-zA-Z0-9]*//g; # Should we quit? if ( $call =~ m/^q.*/ ) { exit; } if ( not $call =~ m/^[a-zA-Z].*[0-9][a-zA-Z].*$/) { system(($^O eq 'MSWin32') ? 'cls' : 'clear'); print "invalid call \n"; next; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: app via inetd and telnet, terminal handling weirdness
by cdarke (Prior) on Jan 31, 2010 at 11:01 UTC | |
by kc2rgw (Initiate) on Jan 31, 2010 at 19:12 UTC | |
by kc2rgw (Initiate) on Jan 31, 2010 at 20:17 UTC |