rspishock has asked for the wisdom of the Perl Monks concerning the following question:
Monks,
I am working on a small script to back up of some files that I am currently working on. The problem that I'm encountering is that when I run the script, I get a "Directory or file not found" error.
A short version of the code I'm using is:
The files that I want to transfer are in the directory pointed to in $from and I am able to successfully reach the location in $to. I have tried several variations of adding and removing *.cmd as well as adding a / to the beginning of the path.use strict; use warnings; use diagnostics; use File::Copy; my $from = "path/to/directory/*.cmd"; my $to = "path/to/new/directory/*.cmd"; copy($from, $to) or die "Copy failed: $!";
I'm sure that I'm missing some trivial detail, however I've been spending more time on this script that I really should and have been coming up empty.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Directory or file not found while using copy
by jethro (Monsignor) on Sep 15, 2011 at 17:22 UTC | |
Re: Directory or file not found while using copy
by blue_cowdawg (Monsignor) on Sep 15, 2011 at 18:16 UTC | |
Re: Directory or file not found while using copy
by wwe (Friar) on Sep 16, 2011 at 08:11 UTC | |
Re: Directory or file not found while using copy
by pvaldes (Chaplain) on Sep 15, 2011 at 18:46 UTC | |
Re: Directory or file not found while using copy
by pvaldes (Chaplain) on Sep 15, 2011 at 18:49 UTC |