in reply to Support for hash comments on a line

I usually just do something like:

while( <FOO> ) { s/\s*#.*$//; next if /^\s*$/; ... }

Anything fancier than that you might want to look into Parse::RecDescent and build a smarter parser, or maybe use AppConfig. Or maybe go to an XML based format and let XML::Parser worry about all of the parsing and comments and what not.