Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by demerphq (Chancellor)
on Oct 14, 2003 at 14:53 UTC ( #299132=note: print w/ replies, xml ) Need Help??


in reply to 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. And the constant-or-variable-with-package-name-in-it approach has the same properties as your code FWICT.

K.I.S.S.

:-)


---
demerphq

    First they ignore you, then they laugh at you, then they fight you, then you win.
    -- Gandhi



Comment on Re: Re: use Very::Long::Module::Name as Foo;
Download Code
Re: Re: Re: use Very::Long::Module::Name as Foo;
by broquaint (Abbot) on Oct 14, 2003 at 15:29 UTC
    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.
    HTH

    _________
    broquaint

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://299132]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2014-07-26 06:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls