in reply to Re: Re: 'our' scoping
in thread 'our' scoping
You have fixed many confusions that I had. I thought that 'use vars' and 'our' were identical, and it did cause me some confusions because some of my code has a mixture of both (pre 5.6 and post 5.6).
I went back and re-read the our documentation in the camel book and it is very precise, and now I understand (I think) what it is talking about.
However, when I went back and re-read the use vars documentation in the camel book, I realize the source of my confusion...
quote (my italics)
This information had led me astray (it may be technically correct, but it confused me nonetheless).This pragma, once used to declare a global variable, is now somewhat deprecated in favor of the our modifier. The previous declaration is better accomplished using :use vars qw($frobbed @munge %seen);...our ($frobbed, @munge, %seen);No matter which of these you use, remember that they're talking about package globals, not file-scoped lexicals.
In closing, I would be really appreciative if you would turn your post into a mini-tutorial.
Thanks,
Sandy
|
|---|