repellent has asked for the wisdom of the Perl Monks concerning the following question:
use File::Spec::Functions qw(catfile splitdir); my @pathnames = splitdir '//special/semantic//path/definition'; my $path1 = catfile @pathnames; # '/special/semantic/path/definition +' my $path2 = join '/', @pathnames; # '//special/semantic//path/definiti +on'
But in Files and Filesystems:
-
Don't assume that in pathnames you can collapse two leading slashes // into one: some networking and clustering filesystems have special semantics for that. Let the operating system to sort it out.
What gives?
Back to
Seekers of Perl Wisdom