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.
In reply to Re^5: How exactly does no work?
by chromatic
in thread How exactly does no work?
by PerlOnTheWay
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |