$me = "dirtest3"; # Perl script to test variations on file/dir test argument quoting use File::Spec; print "All of the following conditions are true on my system.\n"; print "The issue is to see which tests work.\n"; print "The final path includes a directory name containing a space.\n"; print "\n"; $part1 = "C:"; $part2 = "users"; $part3 = "public"; $part4 = "Music"; $part5 = "Sample Music"; $full = File::Spec->catfile( $part1, $part2, $part3, $part4, $part5 ); print "\nThese tests use a path consisting of concatenated substrings:\n"; print " full = '$full'\n"; print "\n"; $expl = "Full path, unquoted"; if ( -e $full ) { print "'-e $expl' is true\n"; } else { print "'-e $expl' is false\n"; } $expl = "Full path in single quotes"; if ( -e '$full' ) { print "'-e $expl' is true\n"; } else { print "'-e $expl' is false\n"; } $expl = "Full path in double quotes"; if ( -e "$full" ) { print "'-e $expl' is true\n"; } else { print "'-e $expl' is false\n"; }