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.

In reply to Can't ioctl TIOCGETP by fbicknel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.