Yes, you are correct about it comparing it to midnight.
Feel free to ask questions. You should pretty much be able to use the Python script as a framework and replace each line with Perl. I would do it myself, but today is a busier day at work than yesterday was.
I'm still bummed that you don't have Python, though. It's so much nicer to work with than Perl -- especially for a beginner. Perl rocks for the super-dense one-liners and regex-intensive short scripts, but Python is cleaner and easier to learn.
Excellent! Glad to help. Perl is the glue that holds the Internet together, after all. It's not surprising that you were able to use it to solve this problem. Happy Wednesday.