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?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: catfile/catdir collapses two leading slashes //
by ikegami (Patriarch) on Sep 17, 2008 at 18:25 UTC | |
by repellent (Priest) on Sep 17, 2008 at 20:31 UTC | |
by ikegami (Patriarch) on Sep 17, 2008 at 22:20 UTC | |
Re: catfile/catdir collapses two leading slashes //
by haoess (Curate) on Sep 17, 2008 at 07:16 UTC | |
by repellent (Priest) on Sep 17, 2008 at 07:37 UTC |
Back to
Seekers of Perl Wisdom