http://qs321.pair.com?node_id=412995


in reply to Difference between 'use' and 'require'

Don't forget the arcane 'unimport' routine that is called when you use 'no' instead of 'use'.

It's good for making subroutines and constants have no-op or undefined values, so that code which calls the module doesn't have to worry about breaking in strict mode.

This only works for modules that have an unimport subroutine defined, though.

Carp::Asset is a good example:

no Carp::Assert; # change to use to enable assert( 0 ), if DEBUG;

Replies are listed 'Best First'.
Re^2: Difference between 'use' and 'require'
by Anonymous Monk on Apr 23, 2014 at 09:12 UTC
    Use excepts module name only. but require excepts whole filename.
      Do you mean "accepts" as in "takes" or "excepts" as in "creates an exception for"?
        Read the docs for use and require and you'll figure it out ; or simply ignore that post as its wrong.

      Use excepts module name only. but require excepts whole filename.

      Sure it doesn't "require excepts" such a thing