News for hackers. Stuff that matters.
Re:Perl is 25 years old today by kablamo on Tuesday December 18, 2012 @10:07AM (#4937775)
> Attach to any running process and analyze away.

Interesting. It never occurred to me to want this. What sort of use case is this for? It seems Perl is capable of something similar:

    use Enbugger::OnError 'USR1';
Then 'kill -USR1 pid' and your process will jump into the debugger.

learn more here: https://metacpan.org/module/JJORE/Enbugger-2.013/lib/Enbugge...

Re:Perl is 25 years old today by jrockway on Tuesday December 18, 2012 @12:18PM (#4938440)
Or strace -p whatever, or gdb -p whatever.

Shockingly, attaching to running processes has been a feature of UNIX for decades.

Re:Perl is 25 years old today by gknoy on Tuesday December 18, 2012 @12:42PM (#4938568)
Wow, that's cool! Thanks for sharing that. Does Perl also have something similar to Python's "import pdb; pdb.set_trace()", which lets you drop into a debugger at a predefined location in your code? I've been finding that really helpful.

Knowing Perl, it probably is possible, and I just never learned about it.

Re:Perl is 25 years old today by prakashk on Tuesday December 18, 2012 @01:11PM (#4938694)
... drop into a debugger at a predefined location in your code?

Add the line where you want the execution to stop:

    $DB::single = 1;
Then, run your program as:

    $ PERLDB_OPTS=NonStop perl -d program.pl
See: http://perldoc.perl.org/perldebug.html