develooper Front page | perl.perl6.language | Postings from February 2001

Re: Really auto autoloaded modules

Thread Previous | Thread Next
From:
John Porter
Date:
February 2, 2001 08:01
Subject:
Re: Really auto autoloaded modules
Message ID:
20010202110114.A25562@min.net
Dan Sugalski wrote:
> 
> The last 
> thing I want is for every module to automagically export all (or even some) 
> of its functions. That way lies namespace pollution *real* fast.

I don't see why this is a concern.  Unless some explicit arrangement
is made for CGI to export param (following the example), a call to
unqualified param() in user code shouldn't find CGI::param, 
automagically loaded or otherwise.

Namespaces is an orthogonal issue, I think.  And so the problem of
autoloading non-core definitions is minimized; if I call CGI::param
explicitly, there's only a few places it can reasonably be expected
to come from.  Vs. calling something like time(), which can only
come from someplace that defines it I<in the main:: space> (or
whatever is the current default namespace) , including by export
from some other namespace.

-- 
John Porter

A pessimist says the CPU is 50% utilized.
An optimist says the CPU is 50% unutilized.
A realist says the network is the bottleneck.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About