in reply to where to use "use" and package

The reason that you need to use the fully qualified name (File::Copy::copy(...)) is because by putting your use's before your package declaration, you've declared them into your main namespace.

Any time you're in a file and haven't declared the namespace with package, the namespace defaults to main. After your package declaration, you're in the Mods::Debug namespace.

So by putting the use's after the package declaration, you import them into the Mods::Debug namespace instead of main. This is the right way to do it.

elusion : http://matt.diephouse.com

Replies are listed 'Best First'.
Re: where to use "use" and package
by Abigail-II (Bishop) on Aug 01, 2002 at 09:29 UTC
    Case matters. The default package is called main, not Main.

    Abigail

Re: Re: where to use "use" and package
by smackdab (Pilgrim) on Aug 01, 2002 at 05:20 UTC
    Thanks, I didn't realize that each namespace would have to load in the *somewhat* "standard" modules. thanks !!!
      If the methods in a module were really standard, they wouldn't be in that module -- they'd be builtins