(Alythh) wrote in news:6a25ba72.0503080906.11cad2f9
@posting.google.com:
> I need to use an input file to a main perl program.
> Since I'm changing its shape often, and I'd like to add comments here
> and there, I was thinking to giving it the shape of a perl program by
> itself, like this:
>
> # comment
> # ...
> $inputvar1=2;
> # comment
> $inputvar2=2;
> ...
The design choice depends on the purpose of this file. Is it used to
tune some configuration parameters? In that case, I myself would have
used a regular configuration file format rather than Perl code. There
are many modules on CPAN that deal with configuration files in various
formats. One particularly simple one is Config::Auto.
> and to include it some way in the main program.
> Problem is, I don't know which command is used to <include> a file.
perldoc -f do
perldoc -f require
perldoc -f use
> I heard about "use" and "require", but it seems to me that they're
> mostly used for defining big libraries and/or OOprogramming, isnt it?
A module need not be "big" or OO.
perldoc perlmod
Sinan.