A. Pagaltzis wrote:
* Adam Kennedy <[EMAIL PROTECTED]> [2006-04-30 07:00]:
The Perl::Critic thing could be tricky though.
One of the very few things PPI does that isn't round-trip safe
(actually, the ONLY thing) is localise the newlines for the
files it opens.
Why would this have to rely on PPI at all? To check whether
newlines in the file are consistent, you can just scan the
source as an opaque of text, no?
A perl source file might have an embedded heredoc, or a DATA section at
the end. Or even something like ...
print "
__DATA__
"; # ha! take that, foolish naive parser!
It might even have binary data, or a non-ASCII character set in any of
those places, although I'd be prepared to accept that that might be bad
practice. It does work very well though and I prefer it to fighting
with the MakeMaker docs to figure out how to get it to install a data
file in the right place :-)
--
David Cantrell