develooper Front page | perl.perl5.porters | Postings from April 2003

Re: [perl #21721] getcwd conflict reported between POSIX and Cwd modules

Thread Previous | Thread Next
Scott R. Godin
April 1, 2003 16:15
Re: [perl #21721] getcwd conflict reported between POSIX and Cwd modules
Message ID:
Stas Bekman wrote:

> Schulte, David (Dave) wrote:
> [...]
>  > Sure, I can change my software to say "do not export anything", since I
>  > always use fully qualified names to be safe, but why should we be
>  > required to do this each time a module changes its implementation? The
>  > only time we should see a "redefined" warning is if we attempt to
>  > invoke a function or method, in an unqualified manner, that is defined
>  > multiple times, or we invoke a function or method from some module that
>  > in turn invokes a function or method in an unqualified manner that is
>  > defined multiple times.
> If you never import things by default, you never have this problem. An
> explicit import of things that you want or FQDN use seems to be the right
> thing to do.
> You probably won't do:
> use POSIX qw(getcwd);
> use Cwd qw(getcwd);

Having noticed the way POSIX works, I generally only import the function I 
need, whenever I 

        use qw/strftime/; # etc etc etc. :-)

thus hopefully avoiding some overhead. 

It might not be a bad idea to mention this in POSIX's synopsis and elsewhere 
in the POD for POSIX, to 'hint' to programmers that this would be a 
desirable thing to do in the future. *sigh* :) 

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About