OK, so I've been puzzling over the semantics of @INC lately, to try to pin down exactly what should happen in Pod::Simple::Search (that's the module I am aiming to replace Pod::Find with).

Now, so far the one thing that's given me pause, is the magic that happens so that when you add ./foo to @INC, that could actually cause these to be added to @INC:
./foo/5.8.0/MSWin32-x86-multi-thread
./foo/5.8.0
./foo/MSWin32-x86-multi-thread
./foo
(where 5.8.0 is replaced with whatever your use Config; $Config{'version'} is,
and "MSWin32-x86-multi-thread" is replaced with whatever your $Config{'archname'} value is.)


The logic behind this is in lib.pm (in Perl) and in perl.c's S_incpush (in C). To make a long story short, if you add to @INC via a direct assignment/push/unshift to @INC, nothing magic happens; but if you do "use lib 'foo';" or have 'foo' in your $ENV{'PERL5LIB'} when perl starts up, then the value of each library dir you add is also prefaced by whichever of ( "$thatdir/ver/archname", "$thatdir/ver", and "$thatdir/archname" ) that currently exist and are directories. (Some more things could also be added, from the things specified in -Dinc_version_list ($Config{'inc_version_list'}), which are typically past version-numbers like $thatdir/5.6.1/MSWin32-x86-multi-thread and "$thatdir/MSWin32-x86-multi-thread".)

And, importantly, those automagical additions are visible in @INC -- they're not in some behind the scenes @_sikrit_real_INC or anything.

Now, here's my question/jab for the list:

My prime motivation for Pod::Simple::Search is to be able to find all the Pod in all of @INC. That's what Pod::Simple::HTMLBatch uses it for (and thus Pod::Webserver, a subclass of Pod::Simple::HTMLBatch).
Pod::Simple::Search does allow specifying other directories to search besides/instead of @INC, but I haven't actually needed to do that myself.


But suppose you were specifying a dir called "foo" that you wanted to be searched besides/instead of what's in @INC. Would anyone on the list be terribly sore if I didn't make Pod::Simple::Search automagically expand "foo" to the list ("foo/5.8.0/MSWin32-x86-multi-thread", "foo/5.8.0", "foo/MSWin32-x86-multi-thread", "foo") ?

I could presume that cases where that's desireable are actually so rare as to be unheard-of and thus irrelevent, but I figure I'd actually ask folks.

--
Sean M. Burke    http://search.cpan.org/~sburke/



Reply via email to