Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

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.
  • by jeremiah (7870) on 2008.11.26 5:29 (#66003) Homepage Journal
    I like the elegance of show with the source filter.
    • Surprise! It's done without a source filter :) It uses Data::Dumper::Names which, in turn, uses PadWalker to fetch the variable names. Test::Most 0.20_01 [cpan.org] has a developer implementation. Already I have a couple of issues.

      First, since Data::Dumper::Names 0.03 is only recommended and not required, one test fails sporadically. My bad :) Also, because this uses PadWalker, this shows us as $VAR1 instead of the variable name:

      show $@;

      That's because $@ is not a lexical. I don't know how to get around that,

      • I wonder if it’s possible to find your caller’s op tree and find your call site in it, then isolate the parameter expression and deparse it… that would be a rock solid approach.

        But I don’t know if the Perl introspection stuff is quite up to that level at this point.