Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Re: Re: use Very::Long::Module::Name as Foo;

by broquaint (Abbot)
on Oct 14, 2003 at 15:29 UTC ( #299144=note: print w/replies, xml ) Need Help??

in reply to Re: Re: use Very::Long::Module::Name as Foo;
in thread use Very::Long::Module::Name as Foo;

Method calls are cached so it makes no difference what package they are called against.
Ah yes, I'm forever forgetting that!
And the constant-or-variable-with-package-name-in-it approach has the same properties as your code FWICT.
But it's not an alias, it's just a shorter way of referring to a package name (although this does equate to the same thing when calling class methods). It means the difference between referring symbolically to the original package, and referring to the package directly via the alias e.g
## accessing a package variable my $path = ${"$var\::Config"}->{'data_path'}; ## vs. my $path = $alias::Config->{'data_path'};
Ok, so it might be a somewhat contrived, but I think it nicely illustrates that the two approaches are not the same.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://299144]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2017-12-18 03:58 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (466 votes). Check out past polls.