Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

comment on

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

Bravo. That is precisely what I think dragonchild was trying to suggest without spelling it out explicitly (as in: "if I think it through fer ye, ya won't learn nuthin'").

It's how I interpreted the original question as I read it, as well.

There seems to sometimes be a tendency amongst (us) developers/programmers/technocrats to overcomplicate, at least in my case, in the sense that the obvious can be overlooked in favor of a literal interpretation that misses the point. Being guilty of the same, however, does not preclude being able to detect when it happens to someone else. Nay, it can make it stand out sometimes (we must all remember "it takes one to know one" from childhood).

It seems to me that asking some questions implies a need for understanding of the realm that the answers might take, and lacking that understanding, the question may understandably suggest to an otherwise knowledgable individual, an unintended specificity that is not actually there.

In this case, the original poster snafu seems (to me) to be asking how to write a block of code in such a way that it may be used as a module (e.g., using user by a larger program and also standalone. The answer as I would deliver it is that it should be written as a module, with an entry point (sub) written to accept what might be command-line arguments. Then, a trivial command-line script (i.e., shell) could be written in several lines which simply loads the module and passes its comand-line arguments directly into the sub, without manipulating them.

My .02 ...


In reply to Re: Possible to have a module act as a standalone?? by dmmiller2k
in thread Possible to have a module act as a standalone?? by snafu

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, 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
  • 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (5)
    As of 2019-07-21 18:54 GMT
    Find Nodes?
      Voting Booth?
      If you were the first to set foot on the Moon, what would be your epigram?

      Results (9 votes). Check out past polls.