I write a lot of apps for others to use and need to give them a way
of changing options, settings, etc. For example, read a list of URLs
from a file, I could force them to put their URLs in urls.txt, instead,
I let them decide the name of the file in a config.txt and my script
reads their settings.
I use to do it like this:
open(IN, "config.txt");
$/=undef;
$slurp = <IN>;
close IN;
$/ = "\n";
eval($slurp);
The dollar slash is Perl's special character for setting the line ending, so by setting it
to undef, the entire file is read in as a single string.
I reset the line ending or I get huge headaches later.
Perl's eval function interprets a string as if it is actual perl code and, of course,
my config.txt files are written that way with cetain lines commented out, etc.
In the config.txt I might have like this:
# PUT THE NAME OF YOUR URLS FILE HERE
$your_urls_filename = 'my_urls.txt';
Anyways, I did this for a long time unil I read about Perl's do function.
Now I just do this..
do("config.txt");
and the "text" of the config.txt file is executed as perl.
cool huh?
well, once in awhile I gotta post something here about Perl or perk might
move the board out of site.

Bompa