Acme-Marvel-CinematicUniverse-Characters
view release on metacpan or search on metacpan
lib/Acme/Marvel/CinematicUniverse/Mite.pm view on Meta::CPAN
sub ro () { 'ro' } sub rw () { 'rw' } sub rwp () { 'rwp' }
sub lazy () { 'lazy' } sub bare () { 'bare' }
# More complicated constants
BEGIN {
my @bool = ( \&false, \&true );
*_HAS_AUTOCLEAN = $bool[ 0+!! eval { require namespace::autoclean } ];
*STRICT = $bool[ 0+!! ( $ENV{PERL_STRICT} || $ENV{EXTENDED_TESTING} || $ENV{AUTHOR_TESTING} || $ENV{RELEASE_TESTING} ) ];
};
# Exportable error handlers
sub _error_handler {
my ( $func, $message, @args ) = @_;
if ( @args ) {
require Data::Dumper;
local $Data::Dumper::Terse = 1;
local $Data::Dumper::Indent = 0;
$message = sprintf $message, map {
ref($_) ? Data::Dumper::Dumper($_) : defined($_) ? $_ : '(undef)'
} @args;
}
my $next = do { require Carp; \&{"Carp::$func"} };
@_ = ( $message );
goto $next;
}
sub carp { unshift @_, 'carp' ; goto \&_error_handler }
sub croak { unshift @_, 'croak' ; goto \&_error_handler }
sub confess { unshift @_, 'confess'; goto \&_error_handler }
# Exportable guard function
{
my $GUARD_PACKAGE = __PACKAGE__ . '::Guard';
*{"$GUARD_PACKAGE\::DESTROY"} = sub { $_[0][0] or $_[0][1]->() };
*{"$GUARD_PACKAGE\::restore"} = sub { $_[0]->DESTROY; $_[0][0] = true };
*{"$GUARD_PACKAGE\::dismiss"} = sub { $_[0][0] = true };
*{"$GUARD_PACKAGE\::peek"} = sub { $_[0][2] };
*guard = sub (&) { bless [ 0, @_ ] => $GUARD_PACKAGE };
}
lib/Acme/Marvel/CinematicUniverse/Mite.pm view on Meta::CPAN
and -f File::Spec->catfile( $base, substr $file, 1 + length $base )
and $orig = File::Spec->abs2rel( $file, $base )
and last;
}
# Changes to this filename must be coordinated with Mite::Compiled
my $mite_file = $orig . '.mite.pm';
local $@;
if ( not eval { require $mite_file; 1 } ) {
my $e = $@;
croak "Compiled Mite file ($mite_file) for $file is missing or an error occurred loading it: $e";
}
}
'warnings'->import;
'strict'->import;
'namespace::autoclean'->import( -cleanee => $caller )
if _HAS_AUTOCLEAN && !$arg{'-unclean'};
}
{
( run in 0.234 second using v1.01-cache-2.11-cpan-65fba6d93b7 )