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

Re: Cwd::cwd() bug??? on Cygwin

Thread Previous | Thread Next
From:
Randy W. Sims
Date:
November 21, 2003 02:07
Subject:
Re: Cwd::cwd() bug??? on Cygwin
Message ID:
3FBD695A.9020307@ThePierianSpring.org
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-----
> 


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