PERL creating variable names with other variable values.

by "Peter Newton" <c-newton(at)ihug.co.nz>

 Date:  Tue, 6 Feb 2001 21:55:34 +1300
 To:  <hwg-techniques(at)hwg.org>
  todo: View Thread, Original
Hello list members,

I hope I can make this question clear, I'm trying to create (using PERL) a
number of variables using a loop and a count so that I can use the count
value to append to the variable name like so:

for ($day=1; $day <= 31; ++$day) {
 $dec1 = ........ blah blah;
}

But I want the variable $dec1 to go to $dec2 etc each time round the loop.
using $day to append the appropriate digit to the variable name $dec.

I've tried:-
 $dec$day
"$dec"."$day"
etc etc

I'm sure I've done this before but cannot find anything.
Can anyone help??

many thanks
Peter Newton

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA