On Tue, 31 Jul 2001, Ron Woodall wrote:

>       I'm trying to take a word from a file and naming a scalar with
> that word.  i.e. I find the word "target" in a file. I then need to
> create $target = "xxx" and various other variables related to target.
> Any suggestions?

Create a hash containing the keywords in the file:

$akey = 'target';

$file_data{$akey} = 'xxx';

Or even a more complex data structure:

$file_data{$akey} = { xxx => 'stuff',
                         yyy => [1, 2, 3]
                    };

How exactly is the data in the file organized?

-- Brett
                                   http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
"Die?  I should say not, dear fellow.  No Barrymore would allow such a
conventional thing to happen to him."
                -- John Barrymore's dying words


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to