Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: How can I create an array that holds number of variables with values?

by turnstep (Parson)
on Dec 26, 2000 at 08:22 UTC ( [id://48288]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://48288]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-19 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found