use warnings; use strict; use feature 'say'; for my $m (map {"File::Spec::$_"} qw/Unix Win32 Mac OS2 VMS Cygwin Epoc/) { say "##### $m #####"; eval qq{ use $m; 1 } or warn "Skipping $m because: $@" and next; say " catdir: ", $m->catdir("foo","bar"); #say " catdir undef: ", $m->catdir("foo","bar",undef); # warns say " catdir blank: ", $m->catdir("foo","bar",""); say " catdir curdir: ", $m->catdir("foo","bar",$m->curdir); #say " catfile undef: ", $m->catfile("foo","bar",undef); # warns say " catfile blank: ", $m->catfile("foo","bar",""); say "catfile curdir: ", $m->catfile("foo","bar",$m->curdir); say " catpath undef: ", $m->catpath(undef,"foo",undef); say " catpath blank: ", $m->catpath(undef,"foo",""); say "catpath curdir: ", $m->catpath(undef,"foo",$m->curdir); } __END__ ##### File::Spec::Unix ##### catdir: foo/bar catdir blank: foo/bar catdir curdir: foo/bar catfile blank: foo/bar/ catfile curdir: foo/bar/. catpath undef: foo catpath blank: foo catpath curdir: foo/. ##### File::Spec::Win32 ##### catdir: foo\bar catdir blank: foo\bar catdir curdir: foo\bar catfile blank: foo\bar catfile curdir: foo\bar catpath undef: foo catpath blank: foo catpath curdir: foo\. ##### File::Spec::Mac ##### catdir: :foo:bar: catdir blank: :foo:bar: catdir curdir: :foo:bar: catfile blank: :foo:bar: catfile curdir: :foo:bar: catpath undef: :foo: catpath blank: :foo: catpath curdir: :foo: ##### File::Spec::OS2 ##### catdir: foo/bar catdir blank: foo/bar catdir curdir: foo/bar catfile blank: foo/bar/ catfile curdir: foo/bar/. catpath undef: foo catpath blank: foo catpath curdir: foo/. ##### File::Spec::VMS ##### Skipping File::Spec::VMS because: Can't locate VMS/Filespec.pm in @INC ##### File::Spec::Cygwin ##### catdir: foo/bar catdir blank: foo/bar catdir curdir: foo/bar catfile blank: foo/bar/ catfile curdir: foo/bar/. catpath undef: foo catpath blank: foo catpath curdir: foo/. ##### File::Spec::Epoc ##### catdir: foo/bar catdir blank: foo/bar catdir curdir: foo/bar catfile blank: foo/bar/ catfile curdir: foo/bar/. catpath undef: foo catpath blank: foo catpath curdir: foo/.