To really answer you, I need a definition of what you intend for
corresponding uptime message. Anyway, I think you want to know "how to preserve (across different script runs) the records that might need to be reprocessed after an uptime message gets logged"... well, I would use a hash tied to a file (see
tie or
Tie::Hash).
Whenever you find an incomplete record you create a new key in the hash with the relevant data for value; when you get the uptime you write out the saved data with the uptime timestamp and you undefine the key from the hash.