delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/11/21/05:41:34

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
MIME-Version: 1.0
Cc: cygwin AT cygwin DOT com, perl5-porters AT perl DOT org,
module-build-general AT lists DOT sourceforge DOT net
Subject: Re: Cwd::cwd() bug??? on Cygwin
In-Reply-To: <3FBD695A.9020307@ThePierianSpring.org> from Randy W. Sims on
Thu, 20 Nov 2003 20:24:42 -0500
References: <3FAF853D DOT 4000202 AT urth DOT org> <3FB00F47 DOT 10400 AT ThePierianSpring DOT org> <
3FB0ACC8 DOT 6030402 AT urth DOT org> <3FB30BB3 DOT 10405 AT ThePierianSpring DOT org> <
3FB50640 DOT 2010908 AT urth DOT org> <3FB55A73 DOT 5060806 AT ThePierianSpring DOT org> <
3FB64CB5 DOT 4060802 AT ThePierianSpring DOT org> <3FBD695A DOT 9020307 AT ThePierianSpring
.org>
To: RandyS AT ThePierianSpring DOT org
Message-Id: <20031121104108.3098.5@llama.elixent.com>
Date: Fri, 21 Nov 2003 10:41:08 +0000
From: Nick Ing-Simmons <nick DOT ing-simmons AT elixent DOT com>
Reply-To: Nick Ing-Simmons <nick DOT ing-simmons AT elixent DOT com>

Randy W. Sims <RandyS AT ThePierianSpring DOT org> 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-----
>> 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019