i have a text file that holds what i want to be variables. like:
Legacy = "/usr/local/bin/doomlegacy"
PrboomClient = "blahblahblah"
i'd like to read the file in and set variables according to what is in the
file. here's my attempt:
#!/usr/bin/perl -w
use diagnostics;
# use strict;
my ($var, $val);
my $ConfigFile = 'config';
open("FP", "< $ConfigFile");
while(<FP>) {
chomp;
/^(\w+)\s*=\s*\"(.*)\"/;
$var = $1;
$val = $2;
$$var = $val;
print $Legacy;
}
close(FP);
the trouble is, $Legacy is undefined. i was under the impression that in
perl, if you have a variable $hello which stored the word "dolly", then you
could say:
my $$hello = "clementine";
and that would assign the word "clementine" to the variable $dolly.
obviously that's not happening. help?
pete
--
"Coffee... I've conquered the Borg on coffee!" [EMAIL PROTECTED]
-- Kathryn Janeway on the virtues of coffee www.dirac.org/p