Stories
Slash Boxes
Comments

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of nicholas (3034)

Thursday April 24, 2008
12:13 PM

Where am I?

[ #36240 ]

(gdb) call Perl_eval_pv(my_perl, "Carp::cluck('Hello world!')", 0)
Hello world! at lib/File/Basename.pm line 52
        File::Basename::BEGIN() called at (eval 28) line 0
        eval {...} called at (eval 28) line 0
        require File/Basename.pm called at lib/File/Copy.pm line 55
        File::Copy::_catname('file-98616', 'lib') called at lib/File/Copy.pm line 112
        File::Copy::copy('file-98616', 'lib') called at lib/File/Copy.t line 125
$8 = (SV *) 0x1008e4838

Yes, it's logical, and I'm sure it's been done before, but I don't remember anyone noting it as a useful hack. Dear lazyweb, which prior art have I missed?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Whenever you're going to do a string eval, use a line directive to set the idea of filenames and line numbers to something useful (ie greppable). It is a ton easier to figure out what "Foo::Bar autogenerated by Baz" is than it is to determine what "eval 28" is.

    (I got this tip from merlyn.)