perhaps a hash of arrays is what you want:

if ($line=~(/^\[\[(\w+)\]\]/)){
$HASH{$1} = [];
}


and you reference the array like

push @{ $HASH{'text'} }, "someinfo";

or anyother array functions.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 27, 2002 9:57 AM
> To: [EMAIL PROTECTED]
> Subject: generating arrays on the fly
> 
> 
> hi,
> 
> what I'm wanting to do is generate an array named after a 
> string that is
> found in a text file.
> 
> i.e something like this:
> if ($line=~(/^\[\[(\w+)\]\]/)){
> @$1=();   #this is the line I want to acheive my aim with!
> }
> 
> I know the syntax is wrong, but hopefully it explains what 
> I'm trying to
> do, any clues?
> 
> thanks,
> Adrian
> 
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

----------------------------------------------------------------------------
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


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

Reply via email to