http://www.perlmonks.org?node_id=1108864


in reply to Re: How to perldebug a Term::ReadLine application (the other way round)
in thread How to perldebug a Term::ReadLine application

Why not:

DEBUG_TTY=`tty` xterm -e perl -d ./myRLprog.pl

Then in myRLprog.pl, include:

if (defined $ENV{DEBUG_TTY}) { my $tty = $ENV{DEBUG_TTY}; open my $out,'>',$tty; open my $in,'<',$tty; my $term = Term::ReadLine->new('Simple Perl calc',$in,$out); } else { ...; }

Would that work?

Replies are listed 'Best First'.
Re^3: How to perldebug a Term::ReadLine application (the other way round)
by LanX (Saint) on Dec 01, 2014 at 18:45 UTC
    well this works

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

    with

    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 ☆☆☆☆ :)