You have a point for your first two .. points. However, on your last point, the reason i stuck with do vs use was that it seemed visually clearer, so the reader would know that i'm attempting to execute code in a seperate file, as opposed to the common interpretation of use, which is that i'm attempting to import a module. However, use 'file.pl' would have the exact same effect with the benefit of error checking and so forth. Of course, a problem there is if you want to call a 'file' multiple times, i dont think multiple uses would execute the code multiple times.

You have a point about just wrapping the file in a sub, but that seems to kind of defeat the purpose =/. You're right about the maintence of a whole folder full of subs, but that mostly holds true for local. If you were trying to remotely maintain something, and you improved one sub, you could just send out a new sub-file, and say 'replace file blah in your sub folder with this new file', as opposed to 'look in blah.pl, find line 952-1060 and replace them with this block of code..'

In reply to Re: Re: Do file.pl (replacing subs?) by BUU
in thread Do file.pl (replacing subs?) by BUU

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.