Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: redeclaring variables with 'my'

by ChOas (Curate)
on Nov 10, 2000 at 17:09 UTC ( [id://40927]=note: print w/replies, xml ) Need Help??


in reply to redeclaring variables with 'my'

Why does he say it is bad behaviour ?
okay, I have to admit that some compilers
'n stuff are not that smart and start allocing
and de-allocing variables right aways when out of
scope (not so handy when you're redeclaring IN
a loop that runs a million times or so)

But, initialising a new var in the while of the loop is not
that bad I think, it's just local to the loop, declared
once, and out of scope out of your loop... works for me..

By the way... while (my $Var) is NOT initialising,
$Var is allocated as undef, then processed by the while,
verified as not true, and the code in the while will
never run

But then again... what do I know....

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-20 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found