Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/self/root/proc/thread-self/root/usr/share/perl5/vendor_perl/Meta/Builder/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/proc/thread-self/root/usr/share/perl5/vendor_perl/Meta/Builder/Util.pm
package Meta::Builder::Util;
use strict;
use warnings;

sub import {
    my $class = shift;
    my $caller = caller;
    inject( $caller, "inject", \&inject );
}

sub inject {
    my ( $class, $sub, $code, $nowarn ) = @_;
    if ( $nowarn ) {
        no strict 'refs';  ## no critic
        no warnings 'redefine';
        *{"$class\::$sub"} = $code;
    }
    else {
        no strict 'refs';  ## no critic
        *{"$class\::$sub"} = $code;
    }
}

1;

__END__

=head1 NAME

Meta::Builder::Util - Utility functions for Meta::Builder

=head1 EXPORTS

=over 4

=item inject( $class, $name, $code, $redefine )

used to inject a sub into a namespace.

=back

=head1 AUTHORS

Chad Granum L<exodist7@gmail.com>

=head1 COPYRIGHT

Copyright (C) 2010 Chad Granum

Meta-Builder is free software; Standard perl licence.

Meta-Builder is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.  See the license for more details.

Hry