Subject: | @_ passthrough ( &$accessor_cref ) throws an exception on repeated calls |
Here is the proper demonstration of the problem, sorry for the false start:
perl -e '
$|++;
package Foo;
use warnings;
use strict;
use Class::Accessor::Inherited::XS (
inherited => "someaccessor"
);
sub around {
my $cref = __PACKAGE__->can("someaccessor");
$cref->(@_);
};
sub around_with_passthrough {
my $cref = __PACKAGE__->can("someaccessor");
&$cref
};
for my $arnd (qw( around around_with_passthrough )) {
for my $try (1,2,3) {
print "Calling $arnd $try ... ";
__PACKAGE__->$arnd;
print "ok\n";
}
}
'
Produces:
Calling around 1 ... ok
Calling around 2 ... ok
Calling around 3 ... ok
Calling around_with_passthrough 1 ... ok
Calling around_with_passthrough 2 ... Usage: $obj->accessor or __PACKAGE__->accessor at -e line 22.
Cheers