in reply to Re^2: question regarding File::Copy, and hashes that contain file paths
in thread question regarding File::Copy, and hashes that contain file paths
It is trying to do just what it says; move file1 (hash key) to file2 (value for that key). The -> is not code, just part of the message. So we’ll add a check for the original and a mkpath for the destination (if necessary) before doing the move; but it seems like you probably don’t have it unzipped the way you think–
for my $key ( keys %files ) { my $original = path($key); die "There is no file $original" unless -f $original; my $destination = path($files{$key}); $destination->parent->mkpath unless -d $destination->parent; $original->move($destination); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: question regarding File::Copy, and hashes that contain file paths
by Leetsauce (Novice) on Dec 16, 2015 at 00:21 UTC |