[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-beginners
Subject:    Re: error messege: "subroutine Cwd::fastcwd redefined"
From:       "Tom Phoenix" <tom () stonehenge ! com>
Date:       2006-03-01 5:13:16
Message-ID: 31086b240602282113t6a337c86o94e361b7afae8df () mail ! gmail ! com
[Download RAW message or body]

On 2/27/06, Frank Lee <lifei03@gmail.com> wrote:

> subroutine Cwd::fastcwd redefined" at C:/per/lib/Cwd.pm line 700
> subroutine Cwd::getcwd redefined at C:/per/lib/Cwd.pm line 700
> subroutine Cwd::abs_path redefined at C:/per/lib/Cwd.pm line 700
>
> The script can still works. Could you tell me how to fix it?

The problem is that the 'use warnings' pragma in your main program is
asking for all warnings even though Cwd is trying (via the older
technology of the magic $^W variable) to keep them from showing up.
(Did somebody say that 'use warnings' is always a good idea? You've
found the exception. :-)

A quick fix would be to ask for no redefinition warnings in your main program:

    use strict;
    use warnings;
    no warnings 'redefine';

But that's a crude fix, and it obscures the real bug. At least, it
seems to be a bug that the Cwd module triggers this message. I can't
be sure whether the line localizing $^W shortly before line 700 should
be supplemented or replaced with "no warnings 'redefine';", or whether
the existing code is fine but Perl isn't respecting it; but in any
case it looks like a bug in the Perl distribution. So would you please
file this as a bug report via perlbug? Thanks!

--Tom Phoenix
Stonehenge Perl Training

-- 
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic