I would suggest not doing something like this, for the following reasons:
#! usr/bin/perl -w
# missing a /, although it doesn't matter on DOS
use File::Copy;
my @list = <C:\LOCATION\*.rtf>;
# You seem to be looking for files named 'LOCATION*.rtf',
# which probably doesn't exist, putting a backslash in
# front of the * makes it a literal *, it isn't a glob
# anymore, and I'm not sure what \L will get you, but it
# probably won't be the letter L.
foreach my $file(@list){
copy ($file,"C:\Temp\");
# \t is a tab, this will fail, unless you actually
# have a directory called 'C:(tab)emp', read perlfaq5
# and always use forward slashes, even in dos
}
As for the dos version, it doesn't even really contain any perl, just put the copy command in a batch script. |