SPUG: Re: @INC different in IE5 and NSNavigator

Richard Anderson starfire at zipcon.net
Wed Sep 20 20:36:31 CDT 2000


This works in my CGI scripts run by Apache and maybe other web servers:

#
# Put directory where this file exists in @INC
BEGIN {
   use File::Basename;
   unshift @INC, dirname($0);
}

I'm having a hard time understanding why the web server would run a CGI
script differently depending on the client that generated the request.  Is
your client on the same system as the web server?  If so, what results do
you get when you try it from another system?

Richard.Anderson at raycosoft.com
www.zipcon.net/~starfire/home (personal)
www.raycosoft.com (corporate)
----- Original Message -----
From: <fred.giorgi at philips.com>
To: <spug-list at pm.org>
Sent: Wednesday, September 20, 2000 1:21 PM
Subject: SPUG: @INC different in IE5 and NSNavigator


> A strange learning experience.
> I have a link on my web page to a perl script that uses a module  called
"sheet.pm" which I wrote. The module is in the same directory as the script
so I put these lines at the top of my script.
> use FindBin;
> use lib $FindBin::Bin;
> use sheet;
> I can execute my script by selecting the html link in Exploder but not in
Navigator. The @INC array is different when using each browser. Navigator
gives me a "d:/TEMP" in @INC  where Exploder gives me the correct path to my
module. I see that Navigator
> copies the script to d:/TEMP before attempting to run it while Explorer
actually runs it from the original location. So Perl does not see my module
located in d:/TEMP and thus aborts.  I had to hard code the link to the
module thus adding :    use lib
> "//the/original/path/to/my/module";
> prior to the    use sheet;   line.
> bummer
> --fred
>
>  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>      POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
>       Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
>   Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
>  For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
>   Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
>
>
>
>


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list