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