I've got about 20ish small scripts that need to be run. More are likely to be created.
They look like:
#!/usr/bin/perl use Some::Module; my $obj = Some::Module->new( %options, code => \&code ); $obj->do_some_work; sub code { ... }; # not always
Mostly its just the arguments to the constructor that differ, but occaisionally a coderef is passed in.
So these scripts all need to get run one after another. I've got something like:
my @files = glob( 'run_me/*' ); while ( my $file = shift @files ) { my $cmd = "perl -Ilib $file >> log"; print STDERR "$cmd\n"; system( $cmd ) == 0 or die "something wrong: $?\n"; }
This is fine, except that I've got a feeling that it could be prettier.
Should I cat all the small scripts together, thus saving the cost of starting perl for each, and the use Some::Module time? (They also each open a database connection and write to it, which could be done just once.) Should I cut down the small scripts to make them just be config files (maybe yes, but I'm not sure I've time left, or how to represent a couple of 'special cases').
Is there something else I've overlooked?
Thanks, qq
In reply to running many small, similar scripts by qq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |