The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Sub::Caller - Add caller information to @_

DESCRIPTION

Sub::Caller provides an easy way to pass caller information to all, or specified, sub-routines:

   use Sub::Caller qw(all); ## Pass to all non-anon subs
   use Sub::Caller qw(sub1 sub2); ## Only these subs

   -- OR --

   use Sub::Caller;

   sub test { }

   &Sub::Caller::addCaller('test');

The functions must be loaded before addCaller() can be called successfully.

If you call addCaller() on the same function(s) multiple times, all calls after the first are silently ignored.

AUTHOR

Shay Harding <sharding@ccbill.com>

TODO

Add some tests.

Would be nice to add this to anonymous functions, but alas, I haven't figured that part out yet. Would probably have to dig into XS more and mess with OP code stuff.

ACKNOWLEDGEMENTS

I just want to say that Gisle Aas' "PerlGuts Illustrated" at http://gisle.aas.no/perl/illguts is fantastic. It really sheds some light on how all those darn SVs work out. Now if only the PERL_CONTEXT section were finished so I knew what those were...