in reply to dynamically creating variables named after the contents of an array

Why don't you use a hash instead?

for (@array){ $hash{$_} = OBJ->new; ... work using variable... }
  • Comment on Re: dynamically creating variables named after the contents of an array
  • Download Code

Replies are listed 'Best First'.
Re: Re: dynamically creating variables named after the contents of an array
by gnu@perl (Pilgrim) on Sep 06, 2002 at 18:28 UTC
    Thanks, for some reason that didn't even strike me. I'll give it a try. Anyone with any more ideas. I would kind of like to see what people come up with on this.