Xxaxx has asked for the wisdom of the Perl Monks concerning the following question:
I've been on the -w bandwagon since day one so at least I don't have those potential messes to look forward to.
However, with the switch to use strict I'm not sure how to handle my globals.
I have three libraries I use for different purposes. I've included them into different scripts using "require". One of these libraries establishes about a dozen global vars that I expect to be floating around in all of my scripts.
Eventually I'll start using proper package::var type syntax. But at the moment I'd like to sneak up on that one script at a time.
Hence I'm looking at the use of "use var" or "our" to declare these globals in my libraries.
Is it true that both will work? Or will I lose scope when the program returns from the required library into the main script?
As you might guess I've been doing all my Perl on street corners and now I'm trying to learn it gooder. ;-)
Claude
p.s. If you know of a tutorial for "Strict after the fact" let me know.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "use vars" vs. "our" or Strict after the fact
by jeroenes (Priest) on Mar 30, 2001 at 16:12 UTC | |
by Xxaxx (Monk) on Mar 30, 2001 at 16:30 UTC | |
|
Re: "use vars" vs. "our" or Strict after the fact
by Desdinova (Friar) on Mar 30, 2001 at 21:38 UTC | |
|
Re: "use vars" vs. "our" or Strict after the fact
by satchboost (Scribe) on Mar 30, 2001 at 22:04 UTC | |
|
Re: "use vars" vs. "our" or Strict after the fact
by epoptai (Curate) on Mar 31, 2001 at 04:01 UTC |