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

Well, I'm not sure it's a good idea to do this, and it will break if you're running with "use strict" (as you defenitly should!), but I think you can do it this way:
for (@array) { $$_ = OBJ->new; ... }
see perldoc strict.

-- Dan

  • 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:31 UTC
    yup, that does break strict. Been there, done that. But thanks though.