in reply to Chaining scripts smartly
You can probably get a long (on unix, at least!) with a driving shell script and real pipeline, for the simpler things -- no need for perl and system. If this starts growing and you need more power, you might prefer to refactor the individual scripts into modules (see perlmod and perlmodlib if you aren't familiar with how to do this), and have the main script drive the various modules in the same process.
It's quite possible to let a module have a standalone entry point (sort of like a "main" function) for using it from the command line, while still offering a programmatic interface. This lets you mix and match your usage to whatever's convenient. The trick is to put this somewhere near the beginning of your module:
if (!caller) { main(); exit; } sub main { # only used when called from the command line # ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Chaining scripts smartly
by loris (Hermit) on Nov 11, 2004 at 12:13 UTC | |
by gaal (Parson) on Nov 11, 2004 at 12:51 UTC |