X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDevel%2FBeginLift.pm;h=90f6a4a46c849a1ede6a21a24c37d917c700968a;hb=refs%2Ftags%2F0.001002;hp=67ff2984362b8d5c30977b7e1524fe484db0f827;hpb=b18c28d9536a2fe1a15d372ba4f3362403d1eb4b;p=p5sagit%2FDevel-BeginLift.git diff --git a/lib/Devel/BeginLift.pm b/lib/Devel/BeginLift.pm index 67ff298..90f6a4a 100644 --- a/lib/Devel/BeginLift.pm +++ b/lib/Devel/BeginLift.pm @@ -4,7 +4,7 @@ use strict; use warnings; use 5.008001; -our $VERSION = 0.001000; +our $VERSION = 0.001002; use vars qw(%lift); use base qw(DynaLoader); @@ -28,7 +28,7 @@ sub setup_for { my ($class, $target, $args) = @_; $lift{$target} ||= []; push @{ $lift{$target} }, map { - setup_for_cv($_); + $class->setup_for_cv($_); } map { ref $_ eq 'CODE' ? $_ @@ -38,7 +38,7 @@ sub setup_for { sub teardown_for { my ($class, $target) = @_; - teardown_for_cv($_) for @{ $lift{$target} }; + $class->teardown_for_cv($_) for @{ $lift{$target} }; delete $lift{$target}; } @@ -111,6 +111,19 @@ Deregisters all subs currently registered for $package and uninstalls begin lifting magic is number of teardown_for calls matches number of setup_for calls. +=head2 setup_for_cv + + $id = Devel::BeginLift->setup_for_cv(\&code); + +Same as C, but only registers begin lifting magic for one code +reference. Returns an id to be used in C. + +=head2 teardown_for_cv + + Devel::BeginLift->teardown_for_cv($id); + +Deregisters begin lifting magic referred to by C<$id>. + =head1 AUTHOR Matt S Trout -