in reply to Re: Re: Re: Re: seeking web host that has a current version of CGI.pm
in thread seeking web host that has a current version of CGI.pm

dsw, My experience in experimenting with this is that it seems like the lib command puts mylib at the end of the list of directories consulted--so that the perl interpreter finds my web host's outdated version of CGI.pm (Version 2.42) first & so doesn't load the version that I've stored at mylib. (The Perl script I've executed to verify the version number still prints out "Version 2.42" so the Perl interpreter seems to be still grabbing the web host's version) Tom
  • Comment on Re: Re: Re: Re: Re: seeking web host that has a current version of CGI.pm

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: seeking web host that has a current version of CGI.pm
by rob_au (Abbot) on Jan 06, 2002 at 07:55 UTC
    According to the lib documentation, the list of directories passed to lib are added to the start of the list - That is saying:

    use lib LIST;

    is equivalent to

    BEGIN { unshift(@INC, LIST) }

    And as such the directory specified will be searched first, rather than last as you suggest.

    I suggest you look at the list which you are passing to lib and also look at what values are contained in @INC immediately prior to your use CGI statement.

     

    Update

    Another interesting module which you may want to look at FindBin whose documentation you can find here which allows library directories to be based upon the script location.

     

    perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'

      rob-au, You are right, of course, that the directory gets tacked onto the "left end" of the @INC. My error. I am having some success with your FindBin suggestion........But my experimentation seems to suggest that the web hosts (buggy) CGI.pm gets picked instead of mine in mylib. The only way I've made some progress is by renaming my CGI.pm as CGI279.pm & specifying the line "use CGI279" in my Perl script........Due to semester starting (I teach), I will have to suspend my efforts for now. But thanks for the useful guidance. Tom