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.
  • I wrote such a module recently. I've called it Carp::Indeed and it uses import()> with CORE::GLOBAL::die() and CORE::GLOBAL::warn() to make it work. To be really honest, this current implementation does not work all the time. I thought about changing the implementation to use $SIG{__FOO__} stuff (which is probably even shorter than the current one - around ten lines of code), but I didn't made the time for this yet. Acme::JavaTrace inspired me.
    • I've just uploaded to CPAN the release 0.03 which does right a couple of things:

      $ perl -MCarp::Indeed -e "sub f { die 'horrible death' }; f('a')"
      horrible death at -e line 1
              main::f('a') called at -e line 1

      $ perl -MCarp::Indeed -e "sub f { use strict; my $a; my @a = @$a }; f('a')"
      Can't use an undefined value as an ARRAY reference at -e line 1
              main::f('a') called at -e line 1

      It is not as robust as it should yet, but better. Thanks, Schwern, for reassu

      • Carp::Indeed 0.03 is indeed doing almost exactly what I want in almost exactly the way I'd written it. Thank you.

        Except the name stinks, why did you choose that name? And the documentation is rather ranty... but that's fixable.
        • He he he. Well, from my non-native English speaker viewpoint, I even thought it was a good name. Yes, the documentation can be pruned down to a description up to the point. I will work on this. But wrt the name, I don't have a clue for a good name (as you noticed).
          • Carp::StackTrace would be a good name then. One would already have a pretty good idea what the module does, without opening the documentation.

            • Not a very good name if you ask me. The important thing isn't that it allows you to make stack traces, Carp already does that. Its that it allows you to make stack traces everywhere! This is why Carp::Everywhere appeals to me.
              • Oh right, I forgot that Carp could already do that. Still, I find "Everywhere" has a slightly cutesy ring to it.

                • Carp::Detailed
                • Carp::Maximum, ::Maximally
                • Carp::Verbose

                Besides, the functionality you want is confess, not carp...

                • Confess::Everything
                • Confess::Deathbed

                Some of my best friends are Catholics. I'll go ask them for some ideas :)

                • Still, I find "Everywhere" has a slightly cutesy ring to it.
                  At what point in this conversation did we stop talking about Perl and switch to Java?
                  Besides, the functionality you want is confess, not carp...
                   
                      Confess::Everything
                  I kinda like that one. We can add more layers of cultural references...

                          Inquisition::Spanish
                          Comfy::Chair
                          Soft::Pillow
                  • Alas, Monty::Python::Inquisition::Spanish is where Guido the Parselmouth [wikipedia.org] got his inspiration for thumbscrew indentation, so we loyal camelistas can't even quote the Camel Spotting sketch [ibras.dk] for fear of endorsing The Other Language [wikipedia.org].

                    Oh dear, I've gone and quoted it ... I'll have to go outside and turn three times.

                    </JOKE>

                    --
                    Bill
                    # I had a sig when sigs were cool
                    use Sig;