This has been a busy week for me. Aside from being week two on my new job, I've also been housesitting for a friend. Were it not for that, I'd be doing some serious work with my regular expression tokens (latest is $Regexp::Token .03 -- which has broken support for HTML comments, but I don't have time to fix that this week). However, it's been a bit of a blessing because I've had to push it in the back of my mind and this has allowed my subconscious to ponder it.
Imagine a logfile that tracks login information with an employee number, a YYYY-MM-DD date followed by other information. How would you extract data to find out which employees worked on their birthdays? There are plenty of ways to do this, but one way would be to create a regular expression token that examines which employee number was matched in $1, fetches that employee's info, check their birthday, and then match that against the date in the next field. The resulting regular expression could look like this:
/^($emp_num)\s+($emp_birthday)/
One could also create a regular expression that would only match weekends if a date is in YYYYMMDD format. This could be useful for logfile analysis:
if (/date: ($is_weekend)/) {...}
Hopefully, I'll get time to write this up properly next week since no one seems to understand my woefully inadequate documentation :)