laziness, impatience, and hubris | |
PerlMonks |
Re: creating an array name using information from another arrayby maa (Pilgrim) |
on Mar 04, 2004 at 19:19 UTC ( [id://333983]=note: print w/replies, xml ) | Need Help?? |
Hi, I'm not sure what the point of the lines scalar(@dev_list) == $#dev_list + 1; scalar(@xref) == $#xref + 1; is since == is an equality test - are these lines supposed to be comments for you? A more perlish way to write your nested for loops would be:
I'm not entirely sure that I understood what you were trying to do but you can create variables named using the contrents of another variable using the ${$varname} style syntax. But then you have to store your created variable's name so you can access it later... it might be easier to pre-dclare a hash and use the keys function. HTH - Mark
In Section
Seekers of Perl Wisdom
|
|