Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: dynamic 2d array

by amarquis (Curate)
on Aug 14, 2008 at 13:45 UTC ( #704349=note: print w/ replies, xml ) Need Help??


in reply to Re^2: dynamic 2d array
in thread dynamic 2d array

Depends on how you define it. The text is talking about global variables, which are available to code outside their containing block:

{ $i = 3; } print "$i\n";

Prints 3. Compare with:

{ my $i = 3; } print "$i\n";

Without strict, this prints only a newline. This code declares a lexically scoped $i, which only persists through the end of its enclosing block. One of the best things about strict/warnings is that perl will complain about this kind of thing, possibly saving you a bunch of time hunting down a confusing error in a large program.


Comment on Re^3: dynamic 2d array
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2015-07-05 22:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls