Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

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/Name.pm 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/Heavy.pm contains only code for the package Carp. Now this might not be the best example as Carp/Heavy.pm 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.


---
demerphq

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



In reply to Re: use Very::Long::Module::Name as Foo; by demerphq
in thread use Very::Long::Module::Name as Foo; by liz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    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: (10)
    As of 2014-09-02 00:01 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite cookbook is:










      Results (18 votes), past polls