Chaim Frankel famously said "The only thing that can parse Perl is perl", effectively killing anyone's chances of writing tools to manipulate Perl source.
Nevertheless, we look at the problems involved in parsing Perl source, and what makes it such a difficult challenge. Next we examine some of the solutions that have been proposed, especially Tim Maher's Perl beautifier and Damian Conway's nascent Parse::Perl module.
We then turn to the solution I recently came up with, tokeniser reporting; we describe how it works and how it can be used from C and Perl programs. Finally, we look at some simple tools built on top of tokeniser reporting to manipulate Perl source, and how even once you have parsed Perl source, pretty printing is still a difficult process.