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