fbicknel has asked for the wisdom of the Perl Monks concerning the following question:

I'm sure many have seen the dilemma: the solution is even posted in the error message:
$ perl -d -e 1 Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 1 Can't ioctl TIOCGETP: Invalid argument Consider installing Term::ReadKey from CPAN site nearby at http://www.perl.com/CPAN Or use perl -MCPAN -e shell to reach CPAN. Falling back to 'stty'. If you do not want to see this warning, set PERL_READLINE_NOWA +RN
Thing is: I did install Term::ReadKey (and Term::ReadLine::Gnu). I just enjoyed the adventure of compiling a new 5.20 Perl and cpanm installs most everything I throw at it without complaining. I know it's using the local versions (I'm using lib::local) as they appear in the dump:
at /scratch/testfrank/lib/perl5/Term/ReadLine/readline.pm line 1730 readline::SetTTY() called at /scratch/testfrank/lib/perl5/Term +/ReadLine/readline.pm line 1580 eval {...} called at /scratch/testfrank/lib/perl5/Term/ReadLin +e/readline.pm line 1580 readline::readline(' DB<1> ') called at /scratch/testfrank/li +b/perl5/Term/ReadLine/Perl.pm line 11 Term::ReadLine::Perl::readline('Term::ReadLine::Perl=ARRAY(0xd +744740)', ' DB<1> ') called at /usr/lib/perl5/5.8.8/perl5db.pl line +6367 DB::readline(' DB<1> ') called at /usr/lib/perl5/5.8.8/perl5d +b.pl line 2203 DB::DB called at -e line 1 DB<1>
So the question is: what else is wrong? ReadLine is working (up arrows, ^R, etc). It's just this annoying message.

I also tried stepping through this code in the debugger. Of course, I can't stop the first time through (at least I don't think I can) but after I get the first prompt, I can stop before the offending routine and watch what happens. This time, it works fine:
DB<3> b 1580 DB<4> x readline::readline(' FOO ') readline::readline(/scratch/testfrank/lib/perl5/Term/ReadLine/readline +.pm:1580): 1580: if (!eval {SetTTY()}) { ## Put into raw mode. auto(-1) DB<<5>> v 1577: $lastdelta = 0; ## Cursor was nowhere 1578: $si = 0; ## Want line to start left-jus +tified 1579: $force_redraw = 1; ## Want to display with brute +force. 1580==>b if (!eval {SetTTY()}) { ## Put into raw mode. 1581: warn $@ if $@; 1582: $dumb_term = 1; 1583: return readline_dumb; 1584 } 1585 1586: *KeyMap = $var_EditingMode; DB<<5>> x eval{SetTTY()} 0 1 DB<<6>> x $@ 0 '' DB<<7>>
Everything looks just fine here.

Replies are listed 'Best First'.
Re: Can't ioctl TIOCGETP
by Anonymous Monk on May 26, 2015 at 19:00 UTC

    You say you installed perl-5.20.x, Term::ReadKey, ..., and then show us libraries loading from ... /usr/lib/perl5/5.8.8/... Are you sure about this??

    The TIOCGETP refers to an old, moldy, ancient, obsolete, tty controlling interface (sgtty) that was used on legacy bsd systems in ye olde times. That's been superseded by posix compatible tcgetattr/tcsetattr (termios). In other words, your system or your perl deployment is misconfigured, borkened, or simply rrong.