|
Mohammed,
You may want to take a look at the
'AppConfig' module; or one of
the other similar modules referenced in the following article.
The only drawback(s) I've found with
AppConfig so far (i.e. since
I've begun trying to use it)
are:
! AppConfig::Getopt cannot parse
hashes passed via command-line (due
to problem <bug?> in
Getopt::Long); it works great for hash
parameters specified in a file,
though, since it handles those
itself.
- Configuration file format is a bit more
restrictive than I'd like
(no in-line comments; requires
line-continuation character)
- not readily installable via AS PPM for
Win32
Only the top issue has really affected my
testing, and it's not
a big deal since I'm not currently passing
hash parameters on the
command-line, anyway.
Good luck!
Karl K.
> Does anyone know of a Perl
module that's used to process > input parameters to a program. What I'm
thinking of is some > sort of function where I can say: > > @vars = getParam( >
"[input 1]", > "[input 2]", >
"[input 3]", > "[input 4]", >
"[input 5]", > "[log file]", >
); > > and the function goes
along and obtains the inputs from the > parameter file and does
preliminary checks such as that all > files exist and that all necessary
inputs are defined. > Ofcourse, the parameter file will contain labels
such as > "[input 1]", "[input 2]" and so on.
|