in reply to "use vars" vs. "our" or Strict after the fact

You can read up on it in require, use and perlmod. There are also a lot of nodes on this subject.

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:

package TrueScope; require 'script42.pl';
Than the perlcode in script42.pl is evaluated in the scope 'TrueScope';

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
    Many thanks. I've already been chasing down the previous references. I'll look into these two new ones with pleasure.