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
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |