David Nicol wrote:


Stas Bekman wrote:

In which case using laundering and eval'ing in the Safe compartment is probably the best idea. Though if I remember correctly Safe has lots of problems (doesn't quite work in certain environments), so I'm not sure how practical it is.



What's the advantage of that over opening the file for reading and looking for /\$VERSION\s*=\s*([^\s\;]+)/ in it? (adjust the regex some to handle quoting if needed)

If it was that simple do you think MM::parse_version wouldn't have done just that. Unfortunately it's not.


Adjusting the version search regex to handle problems such as the
version is deswcribed on multiple lines, or the version is described
within quotes -- workarounds are possible, but it seems like
documenting that that is what your version checker does and doing it
instead of trying to compensate for all edge cases would be a reasonable
approach.

That's is what documented:


http://pause.perl.org/pause/query?ACTION=pause_04about
----------------------------------------
Other conventions you should know about
[...]
Please make sure all your *.pm files contain a $VERSION variable that conforms to the CPAN rules, i.e. the complete computation of $VERSION must take place on the one first line within the module that assigns to it. You can test if this is the case by running


perl -MExtUtils::MakeMaker -le 'print MM->parse_version(shift)' 'file'

on the filenames in question. The CPAN indexer will run this code within a Safe compartement, so maybe even if the above command succeeds, PAUSE may fail if you're doing file IO or other potentially dangerous things within that line.
----------------------------------------


As usual, i might not know what I'm talking about.



--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Reply via email to