in reply to Re^2: File::Spec::Win32 returning different result than File::Spec when doing catfile with empty string
in thread File::Spec::Win32 returning different result than File::Spec when doing catfile with empty string

If you improve your algorithm to process directories as arrays of name components instead of copying back to strings, it will not be a problem any more and your algorithm should be faster, too.

As for the odd behavior, I suspect that it was needed for portability to some oddball half-broken commercial Unix back in the 5.005 era. :-)

  • Comment on Re^3: File::Spec::Win32 returning different result than File::Spec when doing catfile with empty string

Replies are listed 'Best First'.
Re^4: File::Spec::Win32 returning different result than File::Spec when doing catfile with empty string
by nysus (Parson) on Sep 08, 2019 at 06:37 UTC
    Yeah, I thought about processing an array but I would still have to use File::Spec to split the file path and I could just feel it in my bones that there would still be some weird cross-platform issue lingering and I just want to go to bed. So I just did letter-by-letter comparison. Speeding it up will have be a task for another day.

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
    $nysus = $PM . ' ' . $MCF;
    Click here if you love Perl Monks