By looking at your code, me thinks it will only copy the immediate contents of the
$workspace directory. You simply read ('first' level) list of files/directories inside the directory (with the
readdir() method) but never actually 'recurse' through sub-directories. I suggest you use the
File::Find module and it's
wanted() method to traverse all sub-directories and copy one file at a time this way (still using the same
File::Copy module) ;-)
UPDATE: actually
here is a post to
comp.lang.perl.misc that seems to do what you are asking (even without the use of
File::Find methods). However, I still believe that doing it the
File::Find way is a bit cleaner than with a recurisve method invocation. {grin}
_____________________
$"=q;grep;;$,=q"grep";for(`find . -name ".saves*~"`){s;$/;;;/(.*-(\d+)
+-.*)$/;
$_=["ps -e -o pid | "," $2 | "," -v "," "];`@$_`?{print"+ $1"}:{print"
+- $1"}&&`rm $1`;
print$\;}