Clean up Perl parser a bit