The DBD::AnyData module handles CSV, XML, HTMLtable, Fixed-Width, Weblog, Ini-file, and many other formats. It's also extensible so if you have a format that isn't providied, you can create a simple parser for it. It was designed for exactly the task you are describing.