Momo

 view release on metacpan or  search on metacpan

lib/Momo.pm  view on Meta::CPAN

        }
        for my $method (qw(before after around)) {
            *{ $package . '::' . $method } = sub {
                Class::Method::Modifiers::install_modifier( $package, $method,
                    @_ );
            };
        }
        set_prototype \&{ $package . '::extends' }, '@';
        set_prototype \&{ $package . '::with' },    '@';
    }
    strict->import;
    warnings->import;
    utf8->import;
    Carp->import;
    if ( $] >= 5.010 ) {
        require 'feature.pm';
        feature->import( ':' . substr("$^V",1,4) );
    }

}

lib/Momo/Role.pm  view on Meta::CPAN

use utf8;
use base qw(Role::Tiny);

sub _getglob  { no strict 'refs'; \*{ $_[0] } }
sub _getstash { no strict 'refs'; \%{"$_[0]::"} }

sub import {
    my $target = caller;
    my $me     = shift;

    strict->import;
    warnings->import( FATAL => 'all' );
    utf8->import;

    no strict 'refs';
    return
      if ( \%{'Role::Tiny::INFO'} )->{$target}
      ;    # already exported into this package
    ( \%{'Role::Tiny::INFO'} )->{$target}{is_role} = 1;

    # get symbol table reference



( run in 0.260 second using v1.01-cache-2.11-cpan-299005ec8e3 )