in reply to Excess =cut breaks module
The message I get when testing is
What this tells me is that the pod block was opened by the =cut directive, and is behaving as I would expect from my reading of perlpodspec.Foo.pm did not return a true value at -e line 1. BEGIN failed--compilation aborted at -e line 1.
From perlpodspec,
Pod content is contained in Pod blocks. A Pod block starts with a line that matches m/\A=[a-zA-Z]/, and continues up to the next line that matches m/\A=cut/ or up to the end of the file if there is no m/\A=cut/ line.Since you are not currently within a pod block when the stray =cut is encountered, it treats it as starting a pod block.
The question then is if the specification should be changed, or left in its simpler form (a match of m/\A=[a-zA-Z]/ starts a pod block, and the next =cut or end of file ends it).
On the one hand, the current state requires that no stray =cut directives exist (at least if you expect the module to work as intended), and keeps the parser fairly simple. On the other hand, it sort of flies in the face of DWIMery. I would probably fall on the side of keeping the parser simple, and updating podchecker to check for this case (=cut starting a POD block), especially since it could actually indicate a missing start tag (code smell).
Update: Firm up my position.
--MidLifeXis
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Excess =cut breaks module
by Marshall (Canon) on Jan 20, 2012 at 17:51 UTC |