Attempt
view release on metacpan or search on metacpan
lib/Sub/Attempts.pm view on Meta::CPAN
727374757677787980818283848586878889909192parameter:
attempts(
"get_pie"
,
tries
=> 3,
method
=> 1);
This
has
the same effect as writing:
sub
get_pie
{
my
$self
=
shift
;
$self
->SUPER::get_pie(
@_
);
}
attempts(
"get_pie"
,
tries
=> 3);
the C<method> parameter
has
no
effect
=cut
sub attempts
lib/Sub/Attempts.pm view on Meta::CPAN
108109110111112113114115116117118119120121122123124125126127
if
(
$args
{method})
{
# this eval is here as we need to switch packages to declare a
# subroutine so SUPER works and with the current limitations of
# perl, there's no way to do that by mucking about with
# typeglobs.
eval
qq{package $package;
sub $subname
{
my \$this = shift;
\$this->SUPER::$subname(\@_)
}
};
$old_sub
= *{
$glob
}{CODE};
}
else
{
croak
"Can't wrap '$subname', doesn't exist in package '$package'"
}
}
( run in 0.420 second using v1.01-cache-2.11-cpan-454fe037f31 )