in reply to Construction of @INC by different versions of perl

"use lib", which adds those "special" subdirectories automatically.
  • Comment on Re: Construction of @INC by different versions of perl

Replies are listed 'Best First'.
Re^2: Construction of @INC by different versions of perl
by muntfish (Chaplain) on Jun 10, 2004 at 09:47 UTC

    Thanks, but I should have mentioned that I want to make this work without changing source code. I'll update my original node.

    Update: further to the above, I've discovered that "use lib" doesn't work with my old perl installation (5.004_04). Looks like this may be because $Config{version} is not defined, which doesn't sound good to me. Is there a workaround?

    s^^unp(;75N=&9I<V@`ack(u,^;s|\(.+\`|"$`$'\"$&\"\)"|ee;/m.+h/&&print$&;
      Nevertheless, look at the lib.pm source code and/or documentation, especially the _get_dirs function.

        Oops, I updated my earlier post before I saw your reply. Yes I did check lib.pm and found that it is using $Config{version} to find the version-specific subdirectory. Unfortunately $Config{version} is not defined in our perl 5.004_04 installation...

        s^^unp(;75N=&9I<V@`ack(u,^;s|\(.+\`|"$`$'\"$&\"\)"|ee;/m.+h/&&print$&;
      I know you said you don't want to modify your source, but to gleen from your statement about 5.0. To be backwards compatible with it, and perfectly compatible with current versions:
      sub BEGIN { push @INC, "/path/to/your/modules"; }