I need to copy entire directory to some location.
What is the best way to do so ? File::Copy
copies only file by file as I saw it.
By the way I work under Windows.
Thanks for help.
Alternatively, right-click the folder, select Show more options and then Copy. In Windows 10 and earlier versions, right-click the folder and select Copy, or click Edit and then Copy. Navigate to the location where you want to place the folder and all its contents.
If you want to get content of given directory, and only it (i.e. no subdirectories), the best way is to use opendir/readdir/closedir: opendir my $dir, "/some/path" or die "Cannot open directory: $!"; my @files = readdir $dir; closedir $dir; You can also use: my @files = glob( $dir .
Maybe look into File::Copy::Recursive.
A quick google search for "perl copy directory file::" finds
File::Copy::Recursive
Looks what you're after.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With