[EMAIL PROTECTED] wrote:
> 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
> 
> 
> 

use eval
  if ($line=~(/^\[\[(\w+)\]\]/)){
  eval('@' .$1 .' = () ') || warn $@
  }


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

Reply via email to