Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^5: Perl array declaring

by BillKSmith (Chaplain)
on Jun 02, 2013 at 03:51 UTC ( #1036546=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Perl array declaring
in thread Perl array declaring

In Tobyink's example, there is only one global variable, $foo. Use of 'use warnings' would have warned about multiple declarations. Change every 'our' to 'my' and the warning changes to reflect new variables masking the old.

In your case, you also have multiple variables with the same name, but in different scopes. As you said, this is sometimes useful, but you should not think of it as multiple declarations of the same variable.

Bill


Comment on Re^5: Perl array declaring

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1036546]
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: (9)
As of 2014-09-15 09:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (145 votes), past polls