in reply to Re^4: Any way to simulate a Windows path handling for File::Spec without Windows?
in thread Any way to simulate a Windows path handling for File::Spec without Windows?

The reason that File::Spec gives different results on different platforms is that File::Spec is intended to adapt to the platform that your program is running on — and different platforms expect different filenames!

If you are only processing filenames within your program, and do not need to map back from these "internal names" to file names (because you are storing the actual local filenames separately), you could use File::Spec to split the names and then specifically use File::Spec::Unix on all platforms to construct *nix-style "internal names" for processing. If I understand correctly, File::Spec::Unix will load on all platforms, so it is always available.

Replies are listed 'Best First'.
Re^6: Any way to simulate a Windows path handling for File::Spec without Windows?
by nysus (Parson) on Sep 08, 2019 at 06:28 UTC

    That's a good suggestion. But I have already changed the algorithm which is no longer dependent upon File::Spec and released a new version of the module.

    $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