Skip Menu |

This queue is for tickets about the Module-ExtractUse CPAN distribution.

Report information
The Basics
Id: 71761
Status: resolved
Priority: 0/
Queue: Module-ExtractUse

People
Owner: Nobody in particular
Requestors: wyant [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.23
Fixed in: (no value)



Subject: [PATCH] 'use' after statement with trailing comment appears to be ignored
It appears that statements with trailing comments cause the following statement to be ignored. In the following real-world snippet, the use of 'strict' is not detected: use 5.008; # Because of MailTools, used by SOAP::Lite. # Otherwise it would be 5.006 because of 'our'. use strict; use warnings; __END__ What appears to be happening is that after removal of obvious comments and splitting on ';', the 'use strict' appears as <<'CODE' # Because of MailTools, used by SOAP::Lite. use strict; CODE which after replacing newlines with spaces becomes a comment line. The attached patch to lib/Module/ExtractUse eats leading comments of this sort, and the attached patch to t/21_comment.t attempts to demonstrate that this fixes the problem.
Subject: 21_comment.pat
Download 21_comment.pat
application/octet-stream 576b

Message body not shown because it is not plain text.

Subject: ExtractUse.pat
Download ExtractUse.pat
application/octet-stream 534b

Message body not shown because it is not plain text.

This has been applied in 0.31. Thanks. On Wed Oct 19 02:21:49 2011, WYANT wrote: Show quoted text
> It appears that statements with trailing comments cause the following > statement to be ignored. In the following real-world snippet, the use of > 'strict' is not detected: > > use 5.008; # Because of MailTools, used by SOAP::Lite. > # Otherwise it would be 5.006 because of 'our'. > > use strict; > use warnings; > __END__ > > What appears to be happening is that after removal of obvious comments > and splitting on ';', the 'use strict' appears as <<'CODE' > # Because of MailTools, used by SOAP::Lite. > > use strict; > CODE > > which after replacing newlines with spaces becomes a comment line. > > The attached patch to lib/Module/ExtractUse eats leading comments of > this sort, and the attached patch to t/21_comment.t attempts to > demonstrate that this fixes the problem.