in reply to Re: my() and our()
in thread my() and our()

There are actually uses (well, at least one that I can think of) for our beyond use 'strict' context. I have had occasion to use our at the top of a file that contained multiple packages so that I could have a package global that was accessible without full qualification throughout the file. E.g.:

package X; our $global = 'Xglobal'; ... more stuff here ... package Y; print $global;

When run, this code prints Xglobal even though the reference to $global is in package Y's space and it was defined as being a global in package X. The our makes all unqualified references to the variable be assumed to be in the X package namespace even after you move into a different namespace. The same effect can be obtained with my(), except that then the variables are not accessible to other perl code that uses/requires this code.

--DrWhy

"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."