Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
well this works

PERLDB_OPTS="ReadLine=0" MASTER_TTY=`tty` xterm -e perl -d calc_TRL.pl

with

use Term::ReadLine; my $tty=$ENV{MASTER_TTY}; open my $out,'>',$tty; open my $in,'<',$tty; my $term = Term::ReadLine->new('Simple Perl calc',$in,$out); my $prompt = "Enter code: "; my $OUT = $term->OUT || \*STDOUT; while ( $_ = $term->readline($prompt) ) { my $res = eval($_); warn $@ if $@; print $OUT $res, "\n" unless $@; $term->addhistory($_) if /\S/; }

otherwise the debugger starts spontaneously to write to the master terminal, IMHO a bug somewhere between debugger and TRL.

My former approach to redirect the app's tty to a slave terminal has the advantage to run without lost of features in IDEs like emacs.

The slave terminal can also be an extra sub-window within the IDE running a terminal emulation.

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)


In reply to Re^3: How to perldebug a Term::ReadLine application (the other way round) by LanX
in thread How to perldebug a Term::ReadLine application by LanX

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others studying the Monastery: (6)
    As of 2020-04-07 10:53 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      The most amusing oxymoron is:
















      Results (42 votes). Check out past polls.

      Notices?