in reply to how to a specific group of files from source directory to destination directory
Also, I think you should check first to see if the inputted string is indeed a directory. Perhaps a check in the opendir call will work.copy "$source/$file", "$dest$file" or die "Can't copy file $file: $!";
Plus, you code contains some stray code. Change this
to
opendir(DIR, $source) or die "Cannot opend the directory '$source': $!";
|
|---|