To follow up: thanks to Tye for the clue:
o My script used FindBin to determine its absolute path.
o FindBin is standard with Perl, in my case 5.005_03.
o FindBin (v1.42) does 'use File::Spec;'
o File::Spec is standard with Perl.
o Perl 5.005_03 has File::Spec v0.6
o Many modules require File::Spec v0.8
o I was doing 'use FindBin' to add my path to @INC,
  to load my custom File::Spec v0.8. But I thus had
  loaded the wrong version of File::Spec before modifying
  @INC.
Tye pointed out that he has previously shown other ways in which FindBin can break, and has suggested a workaround using $0. This doesn't seem to provide a path that one can unshift onto @INC, though.

Another suggestion has been to remove the loaded File::Spec from %INC, but it seems we have to worry about symbols we've exported. I've checked the source of File::Spec and it doesn't export anything by default. But it looks like FindBin calls all kinds of methods on it :(

Meanwhile I'm hacking around with `pwd` but of course now I have to check that the user is in the right directory, but ... I still don't know where I am!!!!

Continuing to look into this.


In reply to FindBin breaks dependency on File::Spec if using non-standard lib dir (WAS: @INC madness %$#%$#$@!) by tonkin
in thread FindBin breaks dependency on File::Spec if using non-standard lib dir (WAS:@INC madness %$#%$#$@!) by tonkin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.