develooper Front page | perl.libwww | Postings from January 2002

problem using perl debugger with HTTP::Daemon

Richard Chen
January 16, 2002 08:51
problem using perl debugger with HTTP::Daemon
Message ID:
Hello All,

Here is the demo script:

$ cat
use HTTP::Daemon;
use HTTP::Status;
my $d = HTTP::Daemon->new || die;
print "Please contact me at: <URL:", $d->url, ">\n";
while (my $c = $d->accept) {
    while (my $r = $c->get_request) {
        if ($r->method eq 'GET' ) {
        } else {

Here is how I use perl debugger to deal with this:

$ perl -d
Loading DB routines from version 1.0402
Emacs support available.

Enter h or `h h' for help.

main::(       my $d = HTTP::Daemon->new || die;
  DB<1> c
Please contact me at: <URL:http://pionex:3519/>

At this point I would like to type 'ctrl-c' and I would expect
be to put in the perl debugger mode.

The problem is that once the statement line
	while (my $c = $d->accept) {
is reached, I cannot type 'ctrl-c' to get into debugger
mode to set breaks and so on.

I found that this problem happens on linux but not on solaris.
For some reason the handling of accept system call seem to
be different on these two platforms. Solaris workes as expected.

I have tried to install a signal hander like this:
but then 'ctrl-c' will make the perl debugger itself quit,
not what I want.

Does anyone know how to make the accept call respond to the
interrupt signal on linux so that the perl debugger work
as expected?

Thanks for any info.

Richard Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About