in reply to Re^4: How exactly does no work?
in thread How exactly does no work?
use is somewhat of an “overloaded” construct in Perl. It can be employed to reference an outside module (use foo;), or as a pragma to request certain compile-time behavior (use strict;).
I think that explanation confuses more than it enlightens. In both cases (pragma and module), use does the same thing:
BEGIN { require 'Module.pm': 'Module'->import; };
It always performs the require (modulo Perl's internal cache of what it's already loaded) and it always performs the import (modulo use Foo ();). use has no idea of whether what it's loading is a pragma. That part's up to the loaded thing's import() method.
|
|---|