in reply to Using Perl to clean up DBs?

Have a look at rotatelog. It probably does all you want and it is written in Perl too!

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law