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 |
Message body not shown because it is not plain text.
Subject: | ExtractUse.pat |
Message body not shown because it is not plain text.