Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Declaring vars

Status
Not open for further replies.

audiopro

Programmer
Joined
Apr 1, 2004
Messages
3,165
Location
GB
When declaring vars, is it enough to just declare eg.
my $Variable;
rather than giving it an actual value ie.
my $Variable=34;

Keith
 
Yes, in perl, you can and are encouraged declaring:

my $var;

w/o initializing a value -- not like c++.
 
depends on the situtaton, but yes you can declare just the variable, or a list of variables:


my ($var1, $var2, @var, %var);

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top