Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • use class 'My::Company::Namespace::Customer';
    use class 'My::Company::Namespace::Preferred::Customer', as => 'Preferred';
     
    my $cust = Customer->new;
    my $pref = Preferred->new;

    So... what would it do if you had not used 'as => 'Preferred' in the second instance?

    It looks like it is "aliasing" the module name (the last part) but that is the same as the previous module... so would it re-alias Customer?

    And... does it alias all modules that are used after calling it? I think I'd really, really

    • It only aliases what you tell it to alias, so no worries there. Also, the entire point of this is to keep things really, really simple. Dirt simple. Making it all OO defeats that. All this module really does (mostly) is to use the package in question and then insert a sub into your namespace that returns the name of the module.