in reply to copy directories

Not a Perl soloution, but probably easier than what you've got here, if you have the luxury of a unix platform:

(cd /source/directory && tar cf - . ) | (cd /dest/directory && tar xvfp -) From the Linux Tips-HOWTO, 2.6, attributed to Alan Cox.

Peace,
-McD