[guest - Thu Oct 13 11:24:32 2005]:
Show quoted text> Adam-
>
> Would it be possible to add a method to PPI::Document that returns the
> the path and filename that was passed into the constructor? If the
> source code was passed as a scalar ref, it could return false (but
> probably not undef). It would just make a few things in
> Perl::Critic a little easier and cleaner. Thanks.
>
> -Jeff
I thought about this for a while when I first did ::Document, and I came
to the conclusion that it would be a bad thing to include in the main
PPI::Document class.
A document should be a document regardless of where it's from. It makes
hex_id work, equivalence, and a number of other concepts that are more
useful than the inconvenience of having to remember the file yourself.
However, if you were to write up a PPI::Document::File subclass that did
what you want, wrote a test script to go with it and submitted them, I'm
sure I could be convinced to add them to the distribution.