Most databases have date manipulation functions built in. If you're using mysql for example (your database probably has different commands for this) you write your sql query as:
TO_DAYS(NOW()) - TO_DAYS(date_column) = 10;
That would return all the matching rows where date_column is 10 days less that today's date. NOW give you the current date, TO_DAYS converts the date to a number of days so that you can do a subtraction. This would be significantly faster than selecting out every row and then doing the date manipulation stuff in perl.
HTH (I can provide a more complete example if you want)
perl -l -e "eval pack('h*','072796e6470272f2c5f2c5166756279636b672');"