AutoReloader
view release on metacpan or search on metacpan
lib/AutoReloader.pm view on Meta::CPAN
sub new {
my $class = shift;
my $caller = caller;
my $sub = gensub ($caller,@_);
bless $sub, $class;
}
sub auto {
shift if __PACKAGE__ || $_[0] eq (caller(0))[0];
$AL {'auto'} = shift if @_;
$AL {'auto'};
}
sub check {
my $self = shift;
if(ref($self)) {
${ $AL {'Sub'} -> {Scalar::Util::refaddr ($self)} -> {'check'} }
= shift if @_;
${ $AL {'Sub'} -> {Scalar::Util::refaddr ($self)} -> {'check'} };
lib/AutoReloader.pm view on Meta::CPAN
${ $AL {'Sub'} -> {Scalar::Util::refaddr ($self)} -> {'checksub'} }
= shift if @_;
${ $AL {'Sub'} -> {Scalar::Util::refaddr ($self)} -> {'checksub'} };
}
else {
$AL {'checksub'} = shift if @_;
$AL {'checksub'};
}
}
sub suffix {
shift if __PACKAGE__ || $_[0] eq (caller(0))[0];
$AL {'suffix'} = shift if @_;
$AL {'suffix'};
}
# default check subroutine
checksub ( __PACKAGE__, sub { (stat $_[0]) [9] } );
# default is not checking
check ( __PACKAGE__, 0);
# gensub - returns an anonymous subroutine.
# Parameters:
( run in 0.227 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )