in reply to An Interesting Gotcha With use/require

See also Universally unimportant and overused.

- tye        

  • Comment on Re: An Interesting Gotcha With use/require (a fix)

Replies are listed 'Best First'.
Re^2: An Interesting Gotcha With use/require (a fix)
by periapt (Hermit) on Feb 09, 2005 at 17:21 UTC
    Is this useful for all programs regardless of whether they use classes or not?

    PJ
    use strict; use warnings; use diagnostics;

      It's useful (or can be) in programs that use use. Note that use (quoting the documentation) is equivalent to:

      BEGIN { require Module; import Module LIST; }

      and "import Module List" is "Module->import( List )", which is "using a class" even if 'Module' isn't object-oriented.

      If you never use use, then that code will never matter.

      - tye        

        Hmmm, thanks tye I'll definitely take a closer look at this

        PJ
        use strict; use warnings; use diagnostics;