http://qs321.pair.com?node_id=430719

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

Esteemed monks,

the gdb debugger can connect to any running process, perl scripts included. So if I know that my script has process id 1234, I can simply call

gdb -p 1234
and boom! I'm connected to the script. But can I also figure out which file and which line the script is currently processing? Typing where shows a stack trace:
(gdb) where #0 0x55000402 in ?? () #1 0x00c75420 in __nanosleep_nocancel () from /lib/tls/libc.so.6 #2 0x00c7526f in sleep () from /lib/tls/libc.so.6 #3 0x080dacea in Perl_pp_sleep () #4 0x080a6044 in Perl_runops_standard () #5 0x0806103e in S_run_body () #6 0x08060e36 in perl_run () #7 0x0805e359 in main ()
Does anyone know enough about perlguts to figure out from here where (file/line) the script is right now?