Proposed fix committed as SVN update 3806.
The patch looks at all package statements rather than the nearest,
because of the practice of putting all POD after __END__, rather than in
line.
There was actually a test that required the code given in the original
ticket to fail, but since it seems to be agreed that the code should
pass, I have modified the test accordingly, and annotated it with the RT
ticket number.