in reply to Log cleanup script

You should be able to match the all caps stuff with a simple
/[A-Z]{2,}/
for each piece of the name, where the curly bracket part means match 2 or more. Now for the whole name, try something like
/([A-Z]{2,})\s+([A-Z]{2,})/

To generate the unique identifiers, I would just create them as you go along and store it in a hash so you can repeat. Something like this might work:

if (exists $ids{JON_DOE}) { # found it, use old s/JON DOE/$ids{JON_DOE}; } else { # create new $ids{JON_DOE} = "UNIQUEID_$i"; $i++; }
Updated: regex for whole name