Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Program structure: subs vs modules vs Selfloader

by ctilmes (Vicar)
on Jun 21, 2004 at 11:56 UTC ( [id://368415]=note: print w/replies, xml ) Need Help??


in reply to Re: Program structure: subs vs modules vs Selfloader
in thread Program structure: subs vs modules vs Selfloader

If the subroutine is only useful in this script, I leave it in.

For any sizeable project, I have a tendency to go the other way and put virtually all of the functionality of the program into Modules.

The front end program(s) just parse command line options and call the right modules. They also hold the POD documentation for the end user. The Modules have the POD documentation for their API.

Then it is really easy to have separate front end test scripts that set up certain conditions and call the modules the same way the real front end program does.

I figure even if the module never gets re-used, it is still nice to have a clean well-documented API to it that can be easily exercised by test scripts.

  • Comment on Re^2: Program structure: subs vs modules vs Selfloader

Replies are listed 'Best First'.
Re^3: Program structure: subs vs modules vs Selfloader
by CountZero (Bishop) on Jun 21, 2004 at 16:11 UTC
    Well, that is the power of Perl: TIMTOWTDI!

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-24 07:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found