Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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

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

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

IMO source filters are a bad idea. My choices for resolving this in an external module would be (in order of preference):

use Some::Very::Long::And::Annoying::Package::Name; use constant SVLAAPN=>'Some::Very::Long::And::Annoying::Package::Name' +; push @SVLAAPN::ISA,'Some::Very::Long::And::Annoying::Package::Name'; my $o=SVLAAPN->new();

Its unlikely I would use the stash approach as that just gives me the heebie-jeebies.

But this comes to an interesting point. An author of such an annoying package can easily provide the alias themselves... Ie in perl/site/lib/Some/Very/Long/And/Annoying/Package/ the author could have easily put

package SVLAAPN; ...

IOW, the package contained in a file that is used need _not_ be the same as the filename would indicate. A good and common example is Carp::Heavy. There is in fact no such thing. The file perl/lib/Carp/ contains only code for the package Carp. Now this might not be the best example as Carp/ is a behind the scenes kinda thing, but it does illustrate the point nicely.

In short while this is groovy and cool looking, it isn't perl (really), and it doesnt belong in production code. Nor do I think there is much need for this type of thing. The problem doesnt arise much and it only takes a few lines of code to sort out when it does. So IMO, this is a bit of overkill.


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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://299121]
[james28909]: how come it is so easy for me to not care what others think while others will mute themselves because they are scare they will be called ignorant or stupid
[james28909]: do you relize how shrodinger felt when he was describing the quantum world? what about neils bohr?
[holli]: it's probably the autist in you. I am like that too, no fucks given about what others think about me
james28909 checks, yep... htere are no fucks to give
[james28909]: another thing i am sick of is hurting others feelings
[1nickt]: james28909 You lost me a bit when you said "show me evolution from intelligence to ignorance". I guess we would have to define the terms, but as I look around at my species and how we are destroying our habitat ...
[james28909]: seems like a person cant even have a belief without hurting someones feelings. i never said my way is the only way. i just said i have pretty good scientific evidence, and then asked for opposing side to present evidence
[james28909]: was downvoted and left without a reply. go figure
[holli]: but then you DO give a fuck
[1nickt]: I don;t think beliefs should be down-voted, just behaviours.

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (14)
As of 2017-12-15 14:26 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (433 votes). Check out past polls.