wakatana has asked for the wisdom of the Perl Monks concerning the following question:

Hello I am crossposting here from this stackoverflow thread.First I would like to apologize if I misunderstood the whole concept of Devel::ebug and how it should be used. So I want do some experiment with Devel::ebug perl module. Here I found some example: What is the perl equivalent of a bash -xv So I took following code and modified it a little bit. According to official documentation Devel::ebug the program method selects which program to load, so this is only thing that I've changed.
#!/usr/bin/perl use strict; use warnings; use Devel::ebug; use Data::Dumper; my $ebug = Devel::ebug->new; # $ebug->program(shift); # OLD VALUE: $ebug->program($ARGV[0]); # NEW VALUE: $ebug->load; until ($ebug->finished) { print "+++ file:", $ebug->filename, " line: ", $ebug->line, "\ +n"; my $pad = $ebug->pad; for my $var (sort keys %$pad) { if (ref $pad->{$var}) { for my $line (split /\n/, Data::Dumper->Dump([$pad->{$ +var}], [$var])) { print "++ $line\n"; } } else { print "++ $var = $pad->{$var}\n"; } } for my $line ($ebug->codelines($ebug->line-3 .. $ebug->line-1) +) { next unless defined $line; print "+ $line\n"; } print "+> ", $ebug->codeline, "\n"; for my $line ($ebug->codelines($ebug->line+1 .. $ebug->line+3) +) { next unless defined $line; print "+ $line\n"; } $ebug->step; }
Then I saved this file as: stacktrace.pl in the same directory I have also file: debugme.pl from What is the perl equivalent of a bash -xv page. But instead of output mentioned on What is the perl equivalent of a bash -xv page I get this:
> ./stacktrace.pl debugme.pl ./stacktrace.pl: exec failed: No such file or directory at /home/wakatana/perl5/lib/perl5/Devel/ebug.pm line 41 Could not connect: Connection refused at /home/wakatana/perl5/lib/ +perl5/Devel/ebug.pm line 71.
Some further debugging pointed me to this:
Proc::Background::Unix::_new(/home/wakatana/perl5/lib/perl5/Proc/Backg +round/Unix.pm:21): 21: my $class = shift; DB<4> c stacktrace.pl: exec failed: No such file or directory at /home/wakatana/perl5/lib/perl5/Devel/ebug.pm line 41 at /home/wakatana/perl5/lib/perl5/Proc/Background/Unix.pm line 54 Proc::Background::Unix::_new('Proc::Background', '/tmp/ebug_backen +d_perl /tmp/debugme.pl') called at /home/wakatana/perl5/lib/perl5/Pro +c/Background.pm line 123 Proc::Background::new('Proc::Background', 'HASH(0x1731f40)', '/tmp +/ebug_backend_perl /tmp/debugme.pl') called at /home/wakatana/perl5/l +ib/perl5/Devel/ebug.pm line 41 Devel::ebug::load('Devel::ebug=HASH(0xbebf10)') called at stacktra +ce.pl line 12 Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, h q, h R or h o to get additional info. Usage: x-terminal-emulator [options] x-terminal-emulator: error: no such option: -c ######### Forked, but do not know how to create a new TTY. ######### Since two debuggers fight for the same TTY, input is severely entang +led. I know how to switch the output to a different window in xterms, OS/ +2 consoles, and Mac OS X Terminal.app only. For a manual switch, put +the name of the created TTY in $DB::fork_TTY, or define a function DB::get_fork_TTY() returning this. On UNIX-like systems one can get the name of a TTY for the given win +dow by typing tty, and disconnect the shell from TTY by sleep 1000000. DB<4> Could not connect: Connection refused at /home/wakatana/perl5/ +lib/perl5/Devel/ebug.pm line 71. at /home/wakatana/perl5/lib/perl5/Devel/ebug.pm line 71 Devel::ebug::attach('Devel::ebug=HASH(0xbebf10)', 3279, 'bobedu') +called at /home/wakatana/perl5/lib/perl5/Devel/ebug.pm line 49 Devel::ebug::load('Devel::ebug=HASH(0xbebf10)') called at stacktra +ce.pl line 12 Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, h q, h R or h o to get additional info.
First I assumed that it was because I run this under the GNU screen and somehow it is unable to create new TTY. But it is not the problem. What I am missing here? PS: Seems the problem occurs when working with Proc::Background::Unix module so above output I obtained using following debugger command:
b Proc::Background::Unix::_new c
Above commands are issued under terminator and also under xterm