Recursive copy

Is there a Perl mod that has a recursive file copy function (similar to
`cp -r` in Unix or `xcopy` in Windows)? File:ath does have a recursive
file deletion function (rmtree) but no recursive copy function (e.g.
cptree).

Advertisements

"gusmeister" <> wrote in message news:<4og0b.661$>...
> Is there a Perl mod that has a recursive file copy function (similar to
> `cp -r` in Unix or `xcopy` in Windows)? File:ath does have a recursive
> file deletion function (rmtree) but no recursive copy function (e.g.
> cptree).

You could combine File::Find which recursively descends directories
and File::Copy which copies files. I can't be sure the following code
will work without knowing a bit more about how you want the
destination to look, but it might go something like this:

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!