mrityunjaynath has asked for the wisdom of the Perl Monks concerning the following question:
i am trying to code a perl script in which one of my objectives is to copy a source folder(which contains files and sub folders) to a target folder. what i have written is as
use strict; use warnings; use File::Copy; use File::Basename; use Cwd; use Data::Dumper; use File::Copy::Recursive; my $source_dirrtl = ("$newpath"."/rtl"); my $target_dirrtl1 = ("$newpath"."/rtl1"); mkdir($target_dirrtl1,0777); opendir(my $DIRRTL1, $source_dirrtl) || die "can't opendir $source_dir +rtl: $!"; my $cp = File::NCopy->new(recursive => 1); my $cp->copy("$source_dirrtl/*",$target_dirrtl1) or die "couldnt copy +$source_dirrtl to $target_dirrtl1);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: error in copy folder recursively
by Perlbotics (Archbishop) on Jul 04, 2015 at 08:38 UTC | |
by mrityunjaynath (Acolyte) on Jul 04, 2015 at 08:43 UTC | |
by marto (Cardinal) on Jul 04, 2015 at 08:56 UTC | |
by mrityunjaynath (Acolyte) on Jul 04, 2015 at 09:08 UTC | |
by marto (Cardinal) on Jul 04, 2015 at 14:09 UTC | |
by Athanasius (Archbishop) on Jul 04, 2015 at 08:54 UTC | |
by hippo (Archbishop) on Jul 04, 2015 at 08:48 UTC | |
|
Re: error in copy folder recursively (missing module)
by Anonymous Monk on Jul 04, 2015 at 08:35 UTC | |
|
Re: error in copy folder recursively
by afoken (Chancellor) on Jul 04, 2015 at 19:12 UTC |