Skip Menu |

This queue is for tickets about the FindBin-libs CPAN distribution.

Report information
The Basics
Id: 124335
Status: resolved
Priority: 0/
Queue: FindBin-libs

People
Owner: Nobody in particular
Requestors: CHORNY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.1502
Fixed in: (no value)



Subject: breaks Cwd::realpath on Windows
use FindBin::libs; use Cwd 'realpath'; print realpath('.'); dies with error "Undefined subroutine &Cwd::fast_abs_path at line 3." Works normally without FindBin::libs. Problem is the test for "abs_path '//';". If I remove it, problem disappears. -- Alexandr Ciornii, http://chorny.net
CC: lembark [...] wrkhors.com
Subject: Re: [rt.cpan.org #124335] breaks Cwd::realpath on Windows
Date: Tue, 6 Feb 2018 21:29:16 -0600
To: bug-FindBin-libs [...] rt.cpan.org
From: Steven Lembark <lembark [...] wrkhors.com>
On Tue, 6 Feb 2018 04:50:15 -0500 "Alexandr Ciornii via RT" <bug-FindBin-libs@rt.cpan.org> wrote: Show quoted text
> Tue Feb 06 04:50:14 2018: Request 124335 was acted upon. > Transaction: Ticket created by CHORNY > Queue: FindBin-libs > Subject: breaks Cwd::realpath on Windows > Broken in: 2.1502 > Severity: Important > Owner: Nobody > Requestors: CHORNY@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=124335 > > > > use FindBin::libs; > use Cwd 'realpath'; > print realpath('.'); > > dies with error "Undefined subroutine &Cwd::fast_abs_path at line 3." > > Works normally without FindBin::libs. > > Problem is the test for "abs_path '//';". If I remove it, problem > disappears.
Catch is that DOS-based filesystems need to use rel2abs rather than abs_path. That includes msdos & vfat. Few questions: Q: What distro/version of Perl are you running? Q: What version of Cwd? Q: What version of Windows? I can think of a possible way around this, but I'll need to know which versions so I can check. The code that depends on '//' is: BEGIN { # however... there have been complaints of # places where abs_path does not work. # # if abs_path fails on the working directory # then replace it with rel2abs and live with # possibly slower, redundant directories. # # the abs_path '//' hack allows for testing # broken abs_path on primitive systems that # cannot handle the rooted system being linked # back to itself. use Cwd qw( &abs_path &cwd ); unless( eval {abs_path '//'; abs_path cwd } ) { # abs_path seems to be having problems, # fix is to stub it out. # # undef avoids nastygram. my $ref = qualify_to_ref 'abs_path', __PACKAGE__; my $sub = File::Spec::Functions->can( 'rel2abs' ); undef &{ $ref }; *$ref = $sub }; } I cannot see how re-defining this in FB::l would affect the operation of Cwd. I have to see what the version of Cwd you are using does internally. It may well be that Cwd has resolved the issue for itself and I can just drop the test enirely. Q: If I have an updated version would you be willing to test it on Windows for me? thanks -- Steven Lembark 1505 National Ave Workhorse Computing Rockford, IL 61103 lembark@wrkhors.com +1 888 359 3508
Require Cwd 3.74 to avoid infinite loop in _perl_abs_path. Hopefully this fixes the problem.