Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Dynamic Variable Names?by erikharrison (Deacon) |
on Jul 23, 2002 at 15:35 UTC ( [id://184453]=note: print w/replies, xml ) | Need Help?? |
You can create variables dynamically, true. But that's not actually what you need here. When ever you have a series of scalars with trailing integers, use an array, and then you can access the array elements in your for loop. Also, using foreach is more idiomatic (which is a fancy word for "better written") Cheers, Erik Light a man a fire, he's warm for a day. Catch a man on fire, and he's warm for the rest of his life. - Terry Pratchet
In Section
Seekers of Perl Wisdom
|
|