Thread: [Module::Build] Alzabo / Module::Build Cygwin installation problem
Status: Beta
Brought to you by:
kwilliams
|
From: Terrence B. <met...@ur...> - 2003-11-10 12:32:03
|
Thanks for all the work to get Module::Build functional under Cygwin. I
was not able to run the more-recent versions of Alzabo until this
happened. However, attempting to install Alzabo-0.80 yields an error
which appears to be coming from Module::Build. I just installed Cygwin 3
days ago, so it is definitely the latest version.
Some of the CPAN.pm output is removed to facilitate reading.
The Perl version is 5.8.0
Module::Build is 0.21
~ $ perl -MCPAN -e 'install Alzabo'
CPAN: Storable loaded ok
Going to read /home/metaperl/.cpan/Metadata
Database was generated on Mon, 10 Nov 2003 07:50:25 GMT
Running install for module Alzabo
Running make for D/DR/DROLSKY/Alzabo-0.80.tar.gz
CPAN: Digest::MD5 loaded ok
CPAN: Compress::Zlib loaded ok
Checksum for
/home/metaperl/.cpan/sources/authors/id/D/DR/DROLSKY/Alzabo-0.80.tar.gz ok
Scanning cache /home/metaperl/.cpan/build for sizes
Deleting from cache: /home/metaperl/.cpan/build/Alzabo-0.80 (10.5>10.0 MB)
Alzabo-0.80/
Alzabo-0.80/t/
Alzabo-0.80/t/05a-rules-mysql.t
Alzabo-0.80/t/02-create.t
...
Alzabo-0.80/INSTALL
Alzabo-0.80/Makefile.PL
Alzabo-0.80/SIGNATURE
CPAN.pm: Going to build D/DR/DROLSKY/Alzabo-0.80.tar.gz
/usr/bin/perl Build.PL
Please select a root directory for Alzabo (schema files will be stored
under this root.
Alzabo root? [/home/metaperl/alzaobo] /home/metaperl/alzabo
The following questions pertain to optional features of Alzabo. These
questions help the installer determine what additional system checks
to perform.
To use the MySQL driver requires DBD::mysql (2.1017).
Do you want to use the MySQL driver? [no]
no
To use the PostgreSQL driver requires DBD::Pg (1.13).
Do you want to use the PostgreSQL driver? [yes]
yes
The information from the following questions are used solely for
testing the pieces of Alzabo that require a real database for proper
testing.
Do tests with Postgres RDBMS? [yes]
yes
Please provide a username that can be used to connect to the Postgres
RDBMS? This user must have the ability to create a new
database/schema.
Username? metaperl
Password for metaperl?
What host is the Postgres RDBMS located on. Press enter to skip this if
the database server is located on the localhost or can be determined
in another way (for example, Oracle can use TNS to find the database).
Host?
What port is the Postgres RDBMS located on. Press enter to skip this.
Port?
Please provide a database name that can be used for testing. A
database/schema with this name will be created and dropped during the
testing process.
Database name? [test_alzabo_pg]
test_alzabo_pg
Usage: Cwd::cwd() at /usr/lib/perl5/site_perl/5.8.0/Module/Build/Base.pm
line 84.
Couldn't run Build.PL: at
/usr/lib/perl5/site_perl/5.8.0/Module/Build/Compat.pm line 120.
Running make test
Make had some problems, maybe interrupted? Won't test
Running make install
Make had some problems, maybe interrupted? Won't install
~ $
|
|
From: Randy W. S. <Ra...@Th...> - 2003-11-10 22:20:34
|
Terrence Brannon wrote: > Thanks for all the work to get Module::Build functional under Cygwin. I > was not able to run the more-recent versions of Alzabo until this > happened. However, attempting to install Alzabo-0.80 yields an error > which appears to be coming from Module::Build. I just installed Cygwin 3 > days ago, so it is definitely the latest version. > It will be at least tomorrow before I can try this out under Cygwin. What happens if you build/test this manually with verbose=1? Randy. |
|
From: Terrence B. <met...@ur...> - 2003-11-11 09:33:09
|
Randy W. Sims wrote:
> Terrence Brannon wrote:
>
>> Thanks for all the work to get Module::Build functional under Cygwin.
>> I was not able to run the more-recent versions of Alzabo until this
>> happened. However, attempting to install Alzabo-0.80 yields an error
>> which appears to be coming from Module::Build. I just installed
>> Cygwin 3 days ago, so it is definitely the latest version.
>>
>
> It will be at least tomorrow before I can try this out under Cygwin.
> What happens if you build/test this manually with verbose=1?
There is no more output than when it was ran by default, assuming I did
things correctly:
~ $ perl -MCPAN -e 'get Alzabo'
~ $ ~ $ cd .cpan/build
~/.cpan/build $ cd Alzabo-0.80/
~/.cpan/build/Alzabo-0.80 $ ls
Build.PL LICENSE Makefile.PL TODO install_helpers t
Changes MANIFEST README eg lib
INSTALL META.yml SIGNATURE inc mason
~/.cpan/build/Alzabo-0.80 $ perl Makefile.PL verbose=1
perl Build.PL verbose=1
Please select a root directory for Alzabo (schema files will be stored
under this root.
Alzabo root? [/home/metaperl/alzaobo] /home/metaperl/alzabo
The following questions pertain to optional features of Alzabo. These
questions help the installer determine what additional system checks
to perform.
To use the MySQL driver requires DBD::mysql (2.1017).
Do you want to use the MySQL driver? [no]
no
To use the PostgreSQL driver requires DBD::Pg (1.13).
Do you want to use the PostgreSQL driver? [yes]
yes
The information from the following questions are used solely for
testing the pieces of Alzabo that require a real database for proper
testing.
Do tests with Postgres RDBMS? [yes]
yes
Please provide a username that can be used to connect to the Postgres
RDBMS? This user must have the ability to create a new
database/schema.
Username? metaperl
Password for metaperl?
What host is the Postgres RDBMS located on. Press enter to skip this if
the database server is located on the localhost or can be determined
in another way (for example, Oracle can use TNS to find the database).
Host?
What port is the Postgres RDBMS located on. Press enter to skip this.
Port?
Please provide a database name that can be used for testing. A
database/schema with this name will be created and dropped during the
testing process.
Database name? [test_alzabo_pg]
test_alzabo_pg
Usage: Cwd::cwd() at /usr/lib/perl5/site_perl/5.8.0/Module/Build/Base.pm
line 84.
Couldn't run Build.PL: at
/usr/lib/perl5/site_perl/5.8.0/Module/Build/Compat.pm line 120.
~/.cpan/build/Alzabo-0.80 $
|
|
From: Randy W. S. <Ra...@Th...> - 2003-11-13 04:42:37
|
On 11/11/2003 4:32 AM, Terrence Brannon wrote:
> Randy W. Sims wrote:
>
>> Terrence Brannon wrote:
>>
>>> Thanks for all the work to get Module::Build functional under Cygwin.
>>> I was not able to run the more-recent versions of Alzabo until this
>>> happened. However, attempting to install Alzabo-0.80 yields an error
>>> which appears to be coming from Module::Build. I just installed
>>> Cygwin 3 days ago, so it is definitely the latest version.
>>>
>>
>> It will be at least tomorrow before I can try this out under Cygwin.
>> What happens if you build/test this manually with verbose=1?
>
>
> There is no more output than when it was ran by default, assuming I did
> things correctly:
>
> ~ $ perl -MCPAN -e 'get Alzabo'
>
> ~ $ ~ $ cd .cpan/build
> ~/.cpan/build $ cd Alzabo-0.80/
> ~/.cpan/build/Alzabo-0.80 $ ls
> Build.PL LICENSE Makefile.PL TODO install_helpers t
> Changes MANIFEST README eg lib
> INSTALL META.yml SIGNATURE inc mason
> ~/.cpan/build/Alzabo-0.80 $ perl Makefile.PL verbose=1
> perl Build.PL verbose=1
>
> Please select a root directory for Alzabo (schema files will be stored
> under this root.
> Alzabo root? [/home/metaperl/alzaobo] /home/metaperl/alzabo
>
> The following questions pertain to optional features of Alzabo. These
> questions help the installer determine what additional system checks
> to perform.
>
>
> To use the MySQL driver requires DBD::mysql (2.1017).
> Do you want to use the MySQL driver? [no]
> no
>
> To use the PostgreSQL driver requires DBD::Pg (1.13).
> Do you want to use the PostgreSQL driver? [yes]
> yes
>
> The information from the following questions are used solely for
> testing the pieces of Alzabo that require a real database for proper
> testing.
> Do tests with Postgres RDBMS? [yes]
> yes
>
> Please provide a username that can be used to connect to the Postgres
> RDBMS? This user must have the ability to create a new
> database/schema.
> Username? metaperl
> Password for metaperl?
>
> What host is the Postgres RDBMS located on. Press enter to skip this if
> the database server is located on the localhost or can be determined
> in another way (for example, Oracle can use TNS to find the database).
> Host?
>
> What port is the Postgres RDBMS located on. Press enter to skip this.
> Port?
>
> Please provide a database name that can be used for testing. A
> database/schema with this name will be created and dropped during the
> testing process.
> Database name? [test_alzabo_pg]
> test_alzabo_pg
> Usage: Cwd::cwd() at /usr/lib/perl5/site_perl/5.8.0/Module/Build/Base.pm
> line 84.
> Couldn't run Build.PL: at
> /usr/lib/perl5/site_perl/5.8.0/Module/Build/Compat.pm line 120.
> ~/.cpan/build/Alzabo-0.80 $
>
>
Ok. Sorry to get back so late on this. I tried yesterday but got
frustrated with Cygwin trying to install PostgreSQL and stuff...
Anyway, I trace this to Alzabo-0.80/inc/Alzabo/Build.PL which does a
'use Cwd' which apparently conflicts with M::B's override of cwd. Can
you comment out that use declaration and post your results.
When I do this it goes a little further listing a bunch of prerequisites
I'm not going to install unless there are further problems because
Cygwin is extremely slow. I can run linux inside a VM Ware virtual
machine faster than Cygwin (no exageration).
Randy.
--
A little learning is a dang'rous thing;
Drink deep, or taste not the Pierian spring;
There shallow draughts intoxicate the brain;
And drinking largely sobers us again.
- Alexander Pope
|
|
From: Terrence B. <met...@ur...> - 2003-11-14 16:43:47
|
Randy W. Sims wrote: > Ok. Sorry to get back so late on this. I tried yesterday but got > frustrated with Cygwin trying to install PostgreSQL and stuff... > Postgresql on Cygwin is a snap. Jason Tishler put together the Postgresql package and here is his install instructions: http://www.tishler.net/jason/software/postgresql/ And I have a little script that does it for me: ~/bin/psql $ cat START_PG #!/bin/sh -x rm /usr/share/postgresql/data/postmaster.pid ipc-daemon2 & postmaster -i -D /usr/share/postgresql/data & ~/bin/psql $ > Anyway, I trace this to Alzabo-0.80/inc/Alzabo/Build.PL which does a > 'use Cwd' which apparently conflicts with M::B's override of cwd. Can > you comment out that use declaration and post your results. a different use Cwd must be commented out. I did a recursive search for all such uses: cd /home/metaperl/.cpan/build/Alzabo-0.80/ find . -type f -print0 | xargs -0 -e grep -n Cwd ./Build.PL:5:#use Cwd; ./inc/Alzabo/Build.pm:10:#use Cwd; ./Makefile.PL:11:# require Cwd; ./Makefile.PL:16: my $cwd = Cwd::cwd(); ./t/lib/Alzabo/Test/Utils.pm:6:#use Cwd (); ./t/lib/Alzabo/Test/Utils.pm:58: my $cwd = Cwd::cwd(); and commented them all out. Now the test suite passes and I am installing Alzabo-0.80. I am a happy man. Many thanks to Randy for his help. > > When I do this it goes a little further listing a bunch of > prerequisites I'm not going to install unless there are further > problems because Cygwin is extremely slow. I can run linux inside a VM > Ware virtual machine faster than Cygwin (no exageration). > hmm, you have me licking my lips. A real Linux installation but with the tcp/ip ease-of-installation of Windows??? and no quirky compile problems because everybody develops and tests on Linux??? hmm.... |
|
From: Randy W. S. <Ra...@Th...> - 2003-11-14 22:42:47
|
Terrence Brannon wrote: > Randy W. Sims wrote: > >> Ok. Sorry to get back so late on this. I tried yesterday but got >> frustrated with Cygwin trying to install PostgreSQL and stuff... >> > Postgresql on Cygwin is a snap. Jason Tishler put together the > Postgresql package and here is his install instructions: <snip usefull info> Thanks. >> Anyway, I trace this to Alzabo-0.80/inc/Alzabo/Build.PL which does a >> 'use Cwd' which apparently conflicts with M::B's override of cwd. Can >> you comment out that use declaration and post your results. > > > a different use Cwd must be commented out. > <snip> There is still a problem to be worked out, but I'm not yet sure where the problem is. Can you tell post your perl & Cwd version. Dave, What versions of perl, Cwd, & M::B have you tested Alzabo with? This problem doesn't seem directly related to Cygwin. It definately should not be an error to 'use Cwd', so this has to be a problem in M::B, Cwd, or perl. Right??? >> I can run linux inside a VM >> Ware virtual machine faster than Cygwin (no exageration). >> > hmm, you have me licking my lips. A real Linux installation but with the > tcp/ip ease-of-installation of Windows??? > and no quirky compile problems because everybody develops and tests on > Linux??? hmm.... > It's a great product. I wouldn't be without it. I think they have a 30 day fully functional trial version. Regards, Randy. |
|
From: Dave R. <au...@ur...> - 2003-11-14 22:45:34
|
On Fri, 14 Nov 2003, Randy W. Sims wrote: > Dave, What versions of perl, Cwd, & M::B have you tested Alzabo with? I've tested Alzabo with Perl 5.6.1 & 5.8.[01], usually using the latest Module::Build. I don't know what versions oCwd I used. However, I realized that I don't actually use Cwd in the build code any more so I removed it. > This problem doesn't seem directly related to Cygwin. It definately > should not be an error to 'use Cwd', so this has to be a problem in > M::B, Cwd, or perl. Right??? I assume so. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ |
|
From: Terrence B. <met...@ur...> - 2003-11-14 23:13:28
|
Randy W. Sims wrote:
>
>
> There is still a problem to be worked out, but I'm not yet sure where
> the problem is. Can you tell post your perl & Cwd version.
>
~/wares/MYTH $ perl -MCwd -e 'print $Cwd::VERSION'
2.06
~/wares/MYTH $ perl -v
This is perl, v5.8.0 built for cygwin-multi-64int
Copyright 1987-2002, Larry Wall
Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
~/wares/MYTH $ perl -MModule::Build -e 'print
$Module::Build::VERSION'
0.21
> Dave, What versions of perl, Cwd, & M::B have you tested Alzabo with?
>
> This problem doesn't seem directly related to Cygwin. It definately
> should not be an error to 'use Cwd', so this has to be a problem in
> M::B, Cwd, or perl. Right???
>
> >> I can run linux inside a VM
>
>>> Ware virtual machine faster than Cygwin (no exageration).
>>>
>> hmm, you have me licking my lips. A real Linux installation but with
>> the tcp/ip ease-of-installation of Windows???
>> and no quirky compile problems because everybody develops and tests
>> on Linux??? hmm....
>>
>
> It's a great product. I wouldn't be without it. I think they have a 30
> day fully functional trial version.
>
> Regards,
> Randy.
>
>
|
|
From: Randy W. S. <Ra...@Th...> - 2003-11-15 15:56:52
|
On 11/14/2003 5:42 PM, Randy W. Sims wrote:
> There is still a problem to be worked out, but I'm not yet sure where
> the problem is. Can you tell post your perl & Cwd version.
>
> Dave, What versions of perl, Cwd, & M::B have you tested Alzabo with?
>
> This problem doesn't seem directly related to Cygwin. It definately
> should not be an error to 'use Cwd', so this has to be a problem in
> M::B, Cwd, or perl. Right???
>
Ok, this might in fact be a Cygwin problem. Cygwin & Cwd. The following
produces the error "Usage: Cwd::cwd() at Module.pm line 6." under Cygwin
perl 5.8.x, but not under MSWin32 perl 5.6.x & 5.8.x. Also if I change
Cwd to Carp I get no error. Can anyone test to make sure this does not
produce errors on any other systems?
Thanks,
Randy.
-----><8-----
# Module.pm
package Module;
sub new {
my $p = shift;
$p->cwd;
}
sub cwd {
require Cwd;
Cwd::cwd;
}
1;
-----><8-----
-----><8-----
# test.pl
package MyModule;
use Module;
use base 'Module';
use Cwd;
package main;
MyModule->new;
-----><8-----
|
|
From: Enache A. <en...@rd...> - 2003-11-21 15:41:04
|
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
|
|
From: Randy W. S. <Ra...@Th...> - 2003-11-21 01:24:54
|
On 11/15/2003 10:56 AM, Randy W. Sims wrote:
> Ok, this might in fact be a Cygwin problem. Cygwin & Cwd. The following
> produces the error "Usage: Cwd::cwd() at Module.pm line 6." under Cygwin
Ok, I finally had a chance to look into this one. Finding the problem
was easy, but I don't know the proper solution. The problem seems to be
that Module::Build call cwd() with the object syntax which passes self
as an argument. In the perl sources (cygwin/cygwin.c), the builtin cwd
does this check:
if(items != 0)
Perl_croak(aTHX_ "Usage: Cwd::cwd()");
and fails on Cygwin because apparently Cygwin is the only OS that
performs this check. What is the proper way to fix this? Is there a way
Module::Build could work around this problem?
Randy.
> -----><8-----
> # Module.pm
> package Module;
>
> sub new {
> my $p = shift;
> $p->cwd;
> }
>
> sub cwd {
> require Cwd;
> Cwd::cwd;
> }
>
> 1;
> -----><8-----
>
> -----><8-----
> # test.pl
> package MyModule;
> use Module;
> use base 'Module';
> use Cwd;
>
> package main;
> MyModule->new;
> -----><8-----
>
|
|
From: Nick Ing-S. <nic...@el...> - 2003-11-21 10:40:23
|
Randy W. Sims <Ra...@Th...> writes:
>On 11/15/2003 10:56 AM, Randy W. Sims wrote:
>> Ok, this might in fact be a Cygwin problem. Cygwin & Cwd. The following
>> produces the error "Usage: Cwd::cwd() at Module.pm line 6." under Cygwin
>
>Ok, I finally had a chance to look into this one. Finding the problem
>was easy, but I don't know the proper solution. The problem seems to be
>that Module::Build call cwd() with the object syntax which passes self
>as an argument. In the perl sources (cygwin/cygwin.c), the builtin cwd
>does this check:
>
> if(items != 0)
> Perl_croak(aTHX_ "Usage: Cwd::cwd()");
>
>and fails on Cygwin because apparently Cygwin is the only OS that
>performs this check. What is the proper way to fix this? Is there a way
>Module::Build could work around this problem?
Yes - it could use Cwd::cwd() as documented - call it as a function
not a method!
>
>Randy.
>
>> -----><8-----
>> # Module.pm
>> package Module;
>>
>> sub new {
>> my $p = shift;
>> $p->cwd;
>> }
>>
>> sub cwd {
>> require Cwd;
>> Cwd::cwd;
>> }
>>
>> 1;
>> -----><8-----
>>
>> -----><8-----
>> # test.pl
>> package MyModule;
>> use Module;
>> use base 'Module';
>> use Cwd;
>>
>> package main;
>> MyModule->new;
>> -----><8-----
>>
|
|
From: Nick Ing-S. <nic...@el...> - 2003-11-21 11:02:46
|
Randy W. Sims <Ra...@Th...> writes:
>>
>> sub cwd {
>> require Cwd;
>> Cwd::cwd;
If you made that
Cwd::cwd();
it would work.
>> }
>>
>> 1;
>> -----><8-----
>>
>> -----><8-----
>> # test.pl
>> package MyModule;
>> use Module;
>> use base 'Module';
>> use Cwd;
If you moved that above the use Module line then when Module.pm
was compiled it would know Cwd::cwd was a function.
>>
>> package main;
>> MyModule->new;
>> -----><8-----
>>
|
|
From: Randy W. S. <Ra...@Th...> - 2003-11-21 11:21:41
|
Nick Ing-Simmons wrote:
> Randy W. Sims <Ra...@Th...> writes:
>
>>>sub cwd {
>>> require Cwd;
>>> Cwd::cwd;
>
>
> If you made that
> Cwd::cwd();
>
> it would work.
nope. I already tried that.
>>>}
>>>
>>>1;
>>>-----><8-----
>>>
>>>-----><8-----
>>># test.pl
>>>package MyModule;
>>>use Module;
>>>use base 'Module';
>>>use Cwd;
>
>
> If you moved that above the use Module line then when Module.pm
> was compiled it would know Cwd::cwd was a function.
Tried that too. Removing it does work though, but that's not a solution;
it's not reasonable to tell clients that subclass your library not to
'use Cwd'.
I'm having a hard time grasping the order in which perl is interpreting
this. What is desired is that $p->cwd() call Module::cwd() which should
then forward the call to Cwd::cwd(). But no matter how I rearrange
things I can't coax the behavior I want.
I'm missing something simple here; I know it...
>>>package main;
>>>MyModule->new;
>>>-----><8-----
>>>
|
|
From: Yitzchak Scott-T. <sth...@ef...> - 2003-11-21 21:21:24
|
On Fri, Nov 21, 2003 at 06:21:51AM -0500, "Randy W. Sims" <Ra...@Th...> wrote: > >>># test.pl > >>>package MyModule; > >>>use Module; > >>>use base 'Module'; > >>>use Cwd; > > > > > >If you moved that above the use Module line then when Module.pm > >was compiled it would know Cwd::cwd was a function. > > Tried that too. Removing it does work though, but that's not a solution; > it's not reasonable to tell clients that subclass your library not to > 'use Cwd'. If your class provides a method foo(), it is reasonable to tell those who subclass that defining a sub foo or importing one from elsewhere into their class will override the base method foo(). > I'm having a hard time grasping the order in which perl is interpreting > this. What is desired is that $p->cwd() call Module::cwd() which should > then forward the call to Cwd::cwd(). But no matter how I rearrange > things I can't coax the behavior I want. > > I'm missing something simple here; I know it... use Cwd (); ?? |
|
From: Nick Ing-S. <ni...@in...> - 2003-11-21 21:02:25
|
Nick Ing-Simmons <nic...@el...> writes:
>>> package MyModule;
>>> use Module;
>>> use base 'Module';
>>> use Cwd;
>
>If you moved that above the use Module line then when Module.pm
>was compiled it would know Cwd::cwd was a function.
Sorry I could not see wood for the trees!
What is happening is that in MyModule you 'use Cwd',
which EXPORTS 'cwd' by default - so now there is a MyModule::cwd
which is a legitimate over-ride of base class's version so...
You call MyModule->new which inherits from Module->new - so far so good.
But then Module::new calls MyModule->cwd which is the imported one.
So fix is:
package MyModule;
use Module;
use base 'Module';
use Cwd (); # No imports!
Alternatively Module's new could do
sub new {
my $p = shift;
Module->cwd; # ignore override by derived class.
}
But that rather spoils it as a base class.
|
|
From: Randy W. S. <Ra...@Th...> - 2003-11-22 08:57:04
|
On 11/21/2003 4:03 PM, Nick Ing-Simmons wrote:
> Nick Ing-Simmons <nic...@el...> writes:
>
>>>>package MyModule;
>>>>use Module;
>>>>use base 'Module';
>>>>use Cwd;
>>
>>If you moved that above the use Module line then when Module.pm
>>was compiled it would know Cwd::cwd was a function.
>
>
> Sorry I could not see wood for the trees!
>
> What is happening is that in MyModule you 'use Cwd',
> which EXPORTS 'cwd' by default - so now there is a MyModule::cwd
> which is a legitimate over-ride of base class's version so...
>
> You call MyModule->new which inherits from Module->new - so far so good.
> But then Module::new calls MyModule->cwd which is the imported one.
> So fix is:
>
> package MyModule;
> use Module;
> use base 'Module';
> use Cwd (); # No imports!
>
> Alternatively Module's new could do
>
> sub new {
> my $p = shift;
> Module->cwd; # ignore override by derived class.
> }
>
> But that rather spoils it as a base class.
>
Ok, both of these work. I see now where I was flawed in understanding
this one.
Many thanks to Nick, Adi, and Yitzchak (May I ask how to pronounce your
name?) for the explanations and solutions.
BTW, strictly speaknig, wouldn't this still be considered a bug, since
the behaviour difers depending on platform.
--
A little learning is a dang'rous thing;
Drink deep, or taste not the Pierian spring;
There shallow draughts intoxicate the brain;
And drinking largely sobers us again.
- Alexander Pope
|