in reply to debugging a running perl script

One trick I use in the perl debugger ('perl -d') is to have it execute until it receives a certain signal. This example shows how to do this for the USR1-signal:

shark$ perl -d ./fork.pl Loading DB routines from perl5db.pl version 1.22 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(./fork.pl:5): $|=1; DB<1> sub break {} DB<2> $SIG{USR1}=\&break DB<3> b break DB<4> c
After you do this, the program continues to run in the debugger until you send it the USR1-signal (ie. 'kill -USR1 <pid>'). When receiving this signal the program stops executing and is controlled again from the debugger prompt.

I just found out that you can use this as wel with forked commands. Just send the USR1-signal to the child-process you want to debug. In my X-windows environment the debugger opened a child-debugger terminal, I don't know how smart the debugger is in other environments.