Chris,
This one is still a false negative on "#!perl -Tw" and is a false positive on "package main; #!!! my co-worker provided this non-Perl-licensed code to Parrot!!!". Yes, that's a highly contrived example. :-) But the false positive would be avoidable by checking the line and column number of the element.
I've been playing around for a while with the shebang line tests, and it struck me that the is_script() function will return true on your contrived example. Here's my reasoning: the line: package main; #!!! my co-worker... gets pulled apart (so-to-speak) by $doc->find_first( 'PPI::Token::Comment' ) and the string #!!! my co-worker... gets returned as the first comment, and this matches the regular expression. m{\A \#!}mx Am I right? I thought it was an interesting, albeit contrived example. Also, the fact that you mention that the shebang should be the first line lead me to think that maybe we could look for misplaced shebang lines, and report an error there as well. I've got a patch for that and can send this in too if you want. Regards, Paul