in reply to copy files and directories recursively

I dont want to use any CPAN module for this.

Why are you unduly hindering yourself?

Some hints: