Getting application ReadLine and Perl debugger ReadLine to cooperate
- From: Andrew DeFaria <adefaria@xxxxxxxxx>
- Date: Wed, 30 Jan 2008 15:26:28 -0800 (PST)
I have an example Perl script that uses Term::ReadLine::Gnu to provide
ReadLine support with command history:
#!/usr/local/bin/perl
use Term::ReadLine;
use Term::ReadLine::Gnu;
my $term = new Term::ReadLine "test";
while () {
$_ = $term->readline ("Command:");
last if !$_;
print "Read command: $_\n":
} # while
exit;
When run it runs fine, doesn't do much, but dutifully reads commands
and stores them in the history. IOW up arrow works to recall commands
and I can edit them. IOW Term::ReadLine::Gnu is installed properly and
functioning.
Now I wish to debug this script. So I do perl -d testReadLine.pl.
Initially the Perl debugger works. I can do commands like l for list
or s for step. However, as soon as I return from the new
Term::ReadLine the debugger is confused. No command does anything.
I fully suspect that the problem lies in the fact that both my Perl
script and the Perl debugger are fighting over STDIN/STDOUT and
confusing each other. The question is how to get them both to play
nice.
Suggestions? Workarounds? Solutions?
.
- Follow-Ups:
- Prev by Date: Can't get PAR packager to run pp
- Next by Date: Re: Can't get PAR packager to run pp
- Previous by thread: Can't get PAR packager to run pp
- Next by thread: Re: Getting application ReadLine and Perl debugger ReadLine to cooperate
- Index(es):
Relevant Pages
|