in reply to "use vars" vs. "our" or Strict after the fact
I think the core of your question is what scope a required file is evaluated in. Well, that is the same scope as the calling script. So if you call 'script42.pl' in the package 'TrueScope' like:
Than the perlcode in script42.pl is evaluated in the scope 'TrueScope';package TrueScope; require 'script42.pl';
Jeroen
"We are not alone"(FZ)
Update: On second thought, I'd better
say some more.
Praises for you, it's a very good idea to switch to use strict. Your code will be cleaner, and terrible bugs will be caught.
Consider to use diagnostics as well. It's a powerful tool. Another thing is use constant to declare constants.
A good thread to catch up on 'our' and 'use strict' is Why is 'our' good?. There is also a FAQ: What's the difference between require and use?.
Happy coding!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: "use vars" vs. "our" or Strict after the fact
by Xxaxx (Monk) on Mar 30, 2001 at 16:30 UTC |