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

Re: [Module::Build] Alzabo / Module::Build Cygwin installation problem

Thread Previous | Thread Next
From:
Enache Adrian
Date:
November 21, 2003 07:41
Subject:
Re: [Module::Build] Alzabo / Module::Build Cygwin installation problem
Message ID:
20031121164017.GA1347@ratsnest.hole
On Sat, Nov 15, 2003 a.d., Randy W. Sims wrote:
> -----><8-----
> # Module.pm
> package Module;
> 
> sub new {
>   my $p = shift;
>   $p->cwd;
> }
> 
> sub cwd {
>   require Cwd;
>   Cwd::cwd;
> }
> 
> 1;
> -----><8-----
> # test.pl
> package MyModule;
> use Module;
> use base 'Module';
> use Cwd;
> 
> package main;
> MyModule->new;
> -----><8-----

That's because Cwd exports its 'cwd' sub by default, and so it messes
your "namespace".
('use Cwd' has the same effect as declaring a 'MyModule::cwd' sub).

Try
	use Cwd ();

Regards,
Adi

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