[Techtalk] debugging perl scripts

Devdas Bhagat devdas at dvb.homelinux.org
Sat Aug 28 19:31:29 EST 2004


On 27/08/04 23:15 -0400, overhaul wrote:
> Hi everyone...   been pretty quiet around here lately!  I'm hoping it 
> isn't a total ghost town and someone's still reading.  :)

I am, just late in answering.

> 
> I have been trying to track down why a certain perl script tends to hang 
> or die leaving behind it's children

Its Perl, add debugging statements. Is this a publicly available script?
A custom script? Can you put the source out somewhere where we can look
at it?

> this script doesn't log anywhere so I have no way of knowing what it's 
> doing when it dies...  the children , however keep on running ..  how 
> can I debug a process that is already  running?

strace(1) comes to mind. Also ltrace(1). There is also the option of
occasionally issuing SIGSTOP to the script and then poking around in its
memory. You could also try the Perl debugger. The Perl debugger requires
that your perl binary be compiled with -DDEBUGGING.

Devdas Bhagat


More information about the Techtalk mailing list