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);
}
| [reply] [Watch: Dir/Any] [d/l] |
Nah, it's unzipping appropriately(perfectly after applying some help I received here. thanks all!). The -> is referencing $zip, which as indicated by the code is the "get" for the archive. File::Copy will create the directory if necessary, so no need to mkdir. I *do* use dirmove, though, when taking it from the staging area to the production environment, after it has been renamed to the appropriate "APEX" prefix/suffix key/value combo.
Basically, I'm unzipping payroll data for multiple companies, and trying to iterate through as much as I can without having to turn it into a c#, object-oriented executable because I am digging PERL so far, and want to continue to learn. Obviously, the code is newbish to the seasoned monk, but I'm learning at my own pace - in a business environment - while getting paid. Win/Win/Win =p
Thanks for all your help!
| [reply] [Watch: Dir/Any] |