perl - copying files

Folks, here is my code:

I am a serious newbie, why doesn't this make copies of my files? I dont get any errors, the files are just not created.

Your help is appreciated

#!/usr/bin/perl

use File::Copy;

$PWD = `pwd`;
$REPORTDIR = "/usr/local/tripwire/tfs/report";

chdir $REPORTDIR;

for (`ls /usr/local/tripwire/tfs/report | grep 2007`)
{
copy("$_","copyfile-$_");
}

First, make sure $_ in the loop is really populated with what you expected to get.

Second, capture all the errors. You called copy() but do not follow by die(), so you will never know why the copy failed. Otherwise, the error should tell you why.

File::Copy - perldoc.perl.org