in reply to Re: Excess =cut breaks module
in thread Excess =cut breaks module

At work, I would treat this as a "meets spec", "request to modify spec/or program" - and the lowest level of priority "bug tracking" (according to the impact).

The "1;" at the end of a module is an executable statement! I think the OP got confused by the implications of this in an included module (the print statement in my test code perhaps makes it more clear what happens).

I am ambivalent as to whether anything needs to or should be done about this. I would probably opt for a doc update "don't do that" in the description of =cut. This is malformed program syntax with a perhaps somewhat obscure symptom.

I missed the details of what constitutes a "heading" in the specs, but my testing lead me to the same conclusion (the parser doesn't reject =cut as a "start of a block") based upon demonstrated behavior. When something "weird" is seen, often some very short test code can at least clarify what is happening.