in reply to Distinguishing code from not code
This might be a good project for someone to get their feet wet with PPI...
Since it can now parse anything, even line noise, you could parse everything in each block and then take the resulting document and apply some heuristics to see whether or not it "looks like" Perl.
Would certainly be a little more thorough than doing regex-like ways.
In Section
Seekers of Perl Wisdom