gnu@perl has asked for the wisdom of the Perl Monks concerning the following question:
I have an array and I wish to use the elements in it as variable names. Basically, I am dynamically creating objects based upon the number of elements in the array. In order to differentiate between the object they obviously have to have unique names. This is where I use the data from the array.
The problem is that I am not sure how to do this, I have tried a number of mehods on my own to no avail.
Here is a little example of what I am doing.
for (@array){ <variable I want to create from $_> = OBJ->new; ... work using variable... }
I would also like to be able to store the newly created variable in another array for use elsewhere.
Any help is appreciated. TIA.
|
|---|