The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Exodist::Util::Alias - Yet another set of aliasing tools

EXPORTS

All exports use Devel::BeginLift. This means they are run at compile time rather than run-time. This is the same os if they have been wrapped in a BEGIN block.

alias( @PACKAGES )

This will load all tha packages specified as arguments (require, no import). Once loaded a subroutine named after the last segmant of the package name will be created which returns the whole package name as a string.

    use Exodist::Util::Alias;
    alias qw/
        My::Package::MyA
        My::Package::MyB
    /;

    my $a = MyA->new();
    my $b = MyB->new();
alias_to( Alias => 'Package', ... )

Like alias() except you provide a map of alias names and packages to which they should map. Like alias it will auto-require tho packages for you.

    use Exodist::Util::Alias;
    alias MyA => My::Package::OtherA,
          MyB => My::Package::OtherB;

    my $a = MyA->new();
    my $b = MyB->new();

AUTHORS

Chad Granum exodist7@gmail.com

COPYRIGHT

Copyright (C) 2010 Chad Granum

Exodist-Util is free software; Standard perl licence.

Exodist-Util 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.