if (not -e $newlocationlocation) { my $perm = 775; mkdir ($newlocation,$perm) or &on_err("Error making Directory\n"); } if (move ($oldlocation,$newlocation)) { print LOGFILE "$theTime,moved,$oldlocation,$folder\n"; } else { warn "Failed to move to folder"; print LOGFILE "$theTime,failed to move,$oldlocation,$folder\n"; }