in reply to How can I create an array that holds number of variables with values?

Also keep in mind that you may not need to initialize them at all - perl can usually figure out what you want to do. For example
my $var1; $var1++; print "Var1 is now $var1\n"; my $var2; $var2 = "Foobar"; print "Var2 is now $var2\n";
Both of the above will work fine. The values start out undefined, and in most cases (but not all) they do not need an explicit initialization.

  • Comment on Re: How can I create an array that holds number of variables with values?
  • Download Code