Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
From the docs:
An "our" declares the listed variables to be valid globals within the enclosing block, file, or "eval". That is, it has the same scoping rules as a "my" declaration, but does not create a local variable. Given that explanation, I would've thought you could use our() to localize a variable. If our() has the same scoping rules as my(), then I would've thought that the following two snippets result the same. and But they don't, and I can't understand why. I'm guessing that it has something to do with the fact the second our() declaration clobbers the first, but that assumption seems to ignore the scoping rules that the docs say are the same as my(). Anyone?
dsb This @ISA my cool %SIG In reply to my() and our() by dsb
|
|