in reply to Re^4: File NCopy concat
in thread File NCopy concat

File::NCopy's copy's argument is a glob pattern, not a file name. This pattern is passed to glob, which considers spaces to be pattern seperators, not literals. Refer to the passage I emphasised in the following snippet from File::Glob's documentation:

Since v5.6.0, Perl's CORE::glob() is implemented in terms of [File::Glob's] bsd_glob(). Note that they don't share the same prototype — CORE::glob() only accepts a single argument. Due to historical reasons, CORE::glob() will also split its argument on whitespace, treating it as multiple patterns, whereas bsd_glob() considers them as one pattern.

Update: File::NCopy works if you execute the following before calling copy:

{ package File::NCopy; use File::DosGlob qw( glob ); }

And if the spaces are backslashed (or quoted).
And if / is used as the path seperator on Windows.

$filename = 'c:/directory\\ name/file\\ name.txt'; $filename = '"c:/directory name/file name.txt"'; $filename = 'c:/"directory name"/"file name.txt"';

Truly, File::NCopy should be used with care if not considered outright broken. At the very least, it would be best if File::NCopy used bsd_glob rather than glob.