in reply to question regarding File::Copy, and hashes that contain file paths
Most of the code is not being used at all… So the problem is probably that you are clobbering your hash somehow with the date stuff but you do not show it here. Or perhaps, judging by the modules you use, you aren’t creating the directories necessary before the move. Or maybe… this thing, File::PerlMove, is the culprit. Clobbering the move from File::Copy and having different usage. Try removing use File::PerlMove; and see if you get better error feedback.
I would also encourage you in another direction. This is simpler and has built in feedback for failures, which of course happens on my box.
use strictures; use Path::Tiny; my %files = ("e:/pervasive/staging/summit/C01" => "e:/pervasive/test/A +PEX012015/C01", "e:/pervasive/staging/summit/C02" => "e:/pervasive/test/A +PEX022015/C02", "e:/pervasive/staging/summit/C03" => "e:/pervasive/test/A +PEX032015/C03", ); for my $key ( keys %files ) { my $original = path($key); my $destination = $files{$key}; $original->move($destination); } __END__ moo@cow[88]~>perl pm/1150117.pl Error rename on 'e:/pervasive/staging/summit/C01' -> 'e:/pervasive/tes +t/APEX012015/C01': No such file or directory at pm/1150117.pl line 13 +.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: question regarding File::Copy, and hashes that contain file paths
by Leetsauce (Novice) on Dec 12, 2015 at 16:29 UTC | |
by Your Mother (Archbishop) on Dec 12, 2015 at 18:15 UTC | |
by Leetsauce (Novice) on Dec 16, 2015 at 00:21 UTC | |
|
Re^2: question regarding File::Copy, and hashes that contain file paths
by Leetsauce (Novice) on Dec 12, 2015 at 16:32 UTC |