Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: How to perldebug a Term::ReadLine application (the other way round)

by LanX (Saint)
on Dec 01, 2014 at 18:45 UTC ( [id://1108867]=note: print w/replies, xml ) Need Help??


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

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1108867]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-19 03:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found