NAME
Fukurama::Class::HideCaller - Pragma to hide wrapper-classes in callers stack
VERSION
Version 0.01 (alpha)
SYNOPSIS
package MyWrapperClass;
use Fukurama::Class::HideCaller('MyWrapperClass');
sub wrap_around_test {
my $sub = \&MyClass::test;
no warnings;
*MyClass::test = sub {
print "before, ";
&{$sub}(@_);
print "after";
}
}
package MyClass;
sub test {
no warnings;
print "middle, caller: " . [caller(0)]->[0] . ", ";
}
package main;
MyWrapperClass->wrap_around_test();
MyClass->test();
# will print: before, middle, caller: main, after
# without the HideCaller, it will print: before, middle, caller: MyWrapper, after
DESCRIPTION
This pragma-like module provides functions to hide a wrapper-class in callers stack. It's a helper class to provide parameter and return value checking without changings in any caller stack.
CONFIG
You can disable the whole behavior of this class by setting
$Fukurama::Class::HideCaller::DISABLE = 1;
EXPORT
METHODS
-
Register a wrapper class to competely hide in caller stack.
AUTHOR, BUGS, SUPPORT, ACKNOWLEDGEMENTS, COPYRIGHT & LICENSE
see perldoc of Fukurama::Class