Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: use strict seems to hose my code

by dsb (Chaplain)
on Apr 24, 2002 at 21:13 UTC ( [id://161794]=note: print w/replies, xml ) Need Help??


in reply to use strict seems to hose my code

my localizes the variable being declared to the current block, so if you are declaring a variable in a loop, and then try to access it outside of that loop you'd get a Global symbol XXXX requires explicit package name error running the script from the command line.
use strict; foreach (0 .. 5) { my $foo++; } print $foo, "\n"; # throws error




Amel

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-19 02:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found