use strict;
use warnings;
use File::Copy;
use File::NCopy;
use constant FILENAME_1 => 'File with spaces in the name.txt';
use constant FILENAME_2 => 'File with spaces in the name2.txt';
use constant FILENAME1 => 'Filename.txt';
use constant FILENAME2 => 'Filename2.txt';
open outFile, '>', FILENAME1;
print outFile "Some text in non-spaced out file\n";
close outFile;
open outFile, '>', FILENAME_1;
print outFile "Some text in the spaced out file\n";
close outFile;
File::NCopy::copy (FILENAME1, FILENAME2) or warn "Non-spaced to non-sp
+aced failed with NCopy\n";
File::NCopy::copy (FILENAME_1, FILENAME2) or warn "Spaced to non-space
+d failed with NCopy\n";
File::NCopy::copy (FILENAME1, FILENAME_2) or warn "Non-spaced to space
+d failed with NCopy\n";
File::NCopy::copy (FILENAME_1, FILENAME_2) or warn "Spaced to spaced f
+ailed with NCopy\n";
File::Copy::copy (FILENAME1, FILENAME2) or warn "Non-spaced to non-spa
+ced failed with Copy\n";
File::Copy::copy (FILENAME_1, FILENAME2) or warn "Spaced to non-spaced
+ failed with Copy\n";
File::Copy::copy (FILENAME1, FILENAME_2) or warn "Non-spaced to spaced
+ failed with Copy\n";
File::Copy::copy (FILENAME_1, FILENAME_2) or warn "Spaced to spaced fa
+iled with Copy\n";
prints:
Spaced to non-spaced failed with NCopy
Spaced to spaced failed with NCopy
DWIM is Perl's answer to Gödel
|