in reply to Re: perl reports fastcwd 'redefined' when using Cwd and -W
in thread perl reports fastcwd 'redefined' when using Cwd and -W

I ran it on FC6. It worked fine. You might try this:

#!/usr/bin/perl use Cwd; use strict; use warnings; no warnings 'redefine'; my $cwd = getcwd(); print "You're in '", getcwd(), "'\n";

Replies are listed 'Best First'.
Re^3: perl reports fastcwd 'redefined' when using Cwd and -W
by ikegami (Patriarch) on Jan 20, 2007 at 03:48 UTC

    That won't work for two reasons.

    • no warnings 'redefine'; won't affect Cwd, just the block in which it appears. It's lexically scoped.
    • The -W used by the OP overrides no warnings.