Using single quotes might solve some problems with spaces: but if the path contained a single quote, it would break again. As written in the documentation of glob, use bsd_glob from File::Glob if you don't want whitespace to be considered a separator.