Package Info

perl-aliased


Use shorter versions of class names


Development/Libraries/Perl

'aliased' is simple in concept but is a rather handy module. It loads the class you specify and exports into your namespace a subroutine that returns the class name. You can explicitly alias the class to another name or, if you prefer, you can do so implicitly. In the latter case, the name of the subroutine is the last part of the class name. Thus, it does something similar to the following:

use Some::Annoyingly::Long::Module::Name::Customer; sub Customer { return 'Some::Annoyingly::Long::Module::Name::Customer'; } my $cust = Customer->new;

This module is useful if you prefer a shorter name for a class. It's also handy if a class has been renamed.

(Some may object to the term "aliasing" because we're not aliasing one namespace to another, but it's a handy term. Just keep in mind that this is done with a subroutine and not with typeglobs and weird namespace munging.)

Note that this is only for 'use'ing OO modules. You cannot use this to load procedural modules. See the the Why OO Only? manpage section. Also, don't let the version number fool you. This code is ridiculously simple and is just fine for most use.


License: Artistic-1.0 or GPL-1.0+
URL: http://search.cpan.org/dist/aliased/

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
0.34-bp150.2.4 info GA Release 2018-07-30 15
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-aliased
0.34-bp151.2.15 info GA Release 2019-05-18 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-aliased
0.34-bp151.3.1 info GA Release 2019-07-16 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-aliased
0.34-bp152.3.19 info GA Release 2020-04-16 15 SP2
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-aliased
0.34-bp153.1.21 info GA Release 2021-03-05 15 SP3
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-aliased