Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Possible to have a module act as a standalone??

by dmmiller2k (Chaplain)
on Mar 19, 2003 at 06:44 UTC ( #244267=note: print w/replies, xml ) Need Help??


in reply to Re: Possible to have a module act as a standalone??
in thread Possible to have a module act as a standalone??

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 ...

dmm

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://244267]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2019-07-21 09:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?






    Results (7 votes). Check out past polls.

    Notices?