Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

File::Copy::Recursive::dircopy File::Copy

can i use the File::Copy instead of File::Copy::Recursive::dircopy for copying the files from the directories

for the following functions

File::Copy::Recursive::dircopy $localdir, $destdir or colored_printout +(RED,"Copy failed: $!"); File::Copy::copy("vertex.txt", $destdir) or colored_printout(RED +,"Copy failed: $!");

Replies are listed 'Best First'.
Re: Can i use the File::Copy instead of File::Copy::Recursive::dircopy.
by Corion (Patriarch) on Mar 25, 2022 at 07:11 UTC

    dircopy will copy subdirectory and their contents. copy will not do that. So if you are only copying files, you likely can use copy in place of dircopy. Otherwise, you will need to write the recursive copying yourself, or use dircopy.