dbonneville has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to successfully use File::Copy::Recursive from File-Copy-Recursive.-0.34.tar
I installed the PM correctly, as I don't get an error that the subroutine can't be found.
The function dircopy takes 2 variables, $orig and $dest for directories.
When I run it, I get an error:
"Uncaught exception from user code: Copy failed at copyfiles.pl at line 17"
Line 17 is simply the call to the function:
dircopy($orig, $dest) or die "Copy failed: $!";
The 2 variables are declared just before:
I have found absolutely no help anywhere on this.my $orig = "myOriginal";<p> my $dest = "myNewDirectory";<p>
Basically, I want to simply copy a directory recursively and create a copy of it somewhere else. Is there a better module to do this? What am I missing here?
Here is the entire bit:
Thanks,#!perl use warnings; use diagnostics; use File::Copy; use File::Path; use File::Copy::Recursive qw(fcopy rcopy dircopy fmove rmove dirmove); print "start\n"; my $orig = "nose"; my $dest = "nosey"; dircopy($orig, $dest) or die "Copy failed: $!"; print "done\n";
Doug
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: File::Copy::Recursive chokes on input
by andyford (Curate) on Aug 23, 2007 at 16:13 UTC | |
by dbonneville (Acolyte) on Aug 23, 2007 at 17:29 UTC | |
by andyford (Curate) on Aug 23, 2007 at 17:45 UTC | |
Re: File::Copy::Recursive chokes on input
by dogz007 (Scribe) on Aug 23, 2007 at 17:32 UTC | |
by dbonneville (Acolyte) on Aug 23, 2007 at 18:34 UTC | |
by dogz007 (Scribe) on Aug 23, 2007 at 20:07 UTC | |
by Anonymous Monk on Aug 24, 2007 at 10:42 UTC | |
Re: File::Copy::Recursive chokes on input
by xdg (Monsignor) on Aug 23, 2007 at 17:25 UTC |