[sf-perl] dynamic use command

Quinn Weaver quinn at fairpath.com
Fri Apr 4 15:57:55 PDT 2008


On Fri, Apr 04, 2008 at 03:04:15AM -0800, Rich Morin wrote:
> At 00:17 -0700 4/4/08, Michael Friedman wrote:
> > The other thing you can do is realize that, according to
> > `perldoc -f use`:
> >
> > 	It [use] is exactly equivalent to
> >        	BEGIN { require Module; import Module LIST; }
> 
> Is this true in the case of "use strict"?

I think so.  Take a look at the strict.pm source code:

vi `perldoc -l strict`

There's a 'sub import' in there which seems to set strict refs and/or subs
and/or vars according to what you write in 'use strict LIST'.

-- 
Quinn Weaver, independent contractor  |  President, San Francisco Perl Mongers
http://fairpath.com/quinn/resume/     |  http://sf.pm.org/
510-520-5217


More information about the SanFrancisco-pm mailing list