Sean M. Burke wrote in perl.pod-people :
> 
> Brian D. Foy recently sent me two little notes about features that he 
> thought might be a fine addition to Perldoc:
>>A while ago the perlfaq-workers folks discussesd adding a -Q switch to 
>>perldoc so people could search the FAQ answers too.  Now that perldoc 
>>development is alive again, perhaps we can expand its usefulness. :)
> And:
>>I have always wanted a perldoc switch that simply prints the module or 
>>document version.  Any chance of getting something that like?

That last remark rings a bell, as I remember having definitively decided
to use the ugly undocumented hack (courtesy of Gisle Aas)
    perl -MSome::Module\ 999
for that task.

Anyway.

There are two ways to determine a module's version :
* the canonical way, which perl uses : call Some::Module->VERSION().
  Unfortunately, this requires the module to be loaded. Loading a
  module doesn't always succeed, and triggers execution of BEGIN blocks.
* the heuristical way, which MakeMaker uses : parse the module's source
  code and eval() the line that defines $VERSION. Doesn't always work.
My mathematical self prefers the first. My pragmatic self, the other.
Have you a preference ?

I note that you said (or that brian said) "module _or_ document
version". Some docs are distributed directly via .pod files -- they
aren't embedded in .pm files. I don't see how a version could be
attached to such a doc file, unless we come up with another new
convention, e.g.

=for perldoc

version: 0.92

=cut

(perllocal.pod hasn't info about additional .pod files that were
installed, right ?)

-- 
You probably wouldn't have expected a communist to have a dog named Harpo.
    -- Malcolm Lowry, Under the Volcano

Reply via email to