Acme-Marvel-CinematicUniverse-Characters
view release on metacpan or search on metacpan
lib/Acme/Marvel/CinematicUniverse/Mite.pm view on Meta::CPAN
defined $Mite::COMPILING and $Mite::COMPILING eq __PACKAGE__;
}
sub import {
my $me = shift;
my %arg = map +( lc($_) => true ), @_;
my ( $caller, $file ) = caller;
if( _is_compiling() ) {
require Mite::Project;
'Mite::Project'->default->inject_mite_functions(
'package' => $caller,
'file' => $file,
'arg' => \%arg,
'shim' => $me,
);
}
else {
# Try to determine original filename for caller, minus libdir.
# This would normally be in %INC but caller hasn't finished loading yet.
require File::Spec;
lib/Acme/Marvel/CinematicUniverse/Mite.pm view on Meta::CPAN
}
}
return;
}
}
# Usage: $me, $caller, $keyword, @has_args
sub HANDLE_has {
my ( $me, $caller, $keyword, $names ) = ( shift, shift, shift, shift );
if ( @_ % 2 ) {
my $default = shift;
unshift @_, ( 'CODE' eq ref( $default ) )
? ( is => lazy, builder => $default )
: ( is => ro, default => $default );
}
my %spec = @_;
my $code;
for my $name ( ref($names) ? @$names : $names ) {
$name =~ s/^\+//;
'CODE' eq ref( $code = $spec{default} )
and ${"$caller\::__$name\_DEFAULT__"} = $code;
'CODE' eq ref( $code = $spec{builder} )
and *{"$caller\::_build_$name"} = $code;
'CODE' eq ref( $code = $spec{trigger} )
and *{"$caller\::_trigger_$name"} = $code;
'CODE' eq ref( $code = $spec{clone} )
and *{"$caller\::_clone_$name"} = $code;
}
return;
}
( run in 0.855 second using v1.01-cache-2.11-cpan-8780591d54d )