Refactor perl/lib/Parser.pm