"be consistent" | |
PerlMonks |
Re: Initialize multiple variables in one statementby stevieb (Canon) |
on Nov 23, 2015 at 19:05 UTC ( [id://1148418]=note: print w/replies, xml ) | Need Help?? |
You can use a hash and populate it based on a list with map:
You can also use an array, but it'll only work if your variables are truly in a numbered order. Note that an array starts at zero and not one though. If your vars aren't literally ordered, use a hash instead.
In Section
Seekers of Perl Wisdom
|
|