Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Comment on

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

Sorry, I disagree. Modularization of code is desirable. IMHO, using a dummy object to acheive this is more valid than fully qualifying the calls for the following reasons:

  • Typically, less typing, as filenames tend to be longer han variable names (in my world, at least)

  • greater flexibility - if you decide to relocate something in the filesystem, you change only your 'use' and 'new' statments, not everyplace the calls are made.

  • "future-proofing" - as the user gains sophisitication, he or she can more easily modify the modules, or create new ones that inherit from the existing. Exporting or fully qualifying can defeat that.

  • "future-proofing" - on the day when the user suddenly wants to set instance data for his routines, he or she is ready.

Besides, fully qualified calls just look ugly to me, though I suppose it's safer than trusting multiple modules not to stomp on each other or your own functions. Using object methods are also fully qualified.

--Bob Niederman, http://bob-n.com

All code given here is UNTESTED unless otherwise stated.


In reply to Re: Re: Re: Re: Using a subroutine as a module by bobn
in thread Using a subroutine as a module by bradcathey

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 about the Monastery: (9)
    As of 2014-08-29 10:17 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (277 votes), past polls