Problem with "require" 
Author Message
 Problem with "require"

[posted & mailed]

        >snip<

: C:\INETPUB\WWWRoot\news\sitename\cgi-bin\test.pl
: line 15.
: ------------------------------------------------
: There is a clean copy of cgi-lib.pl in the /cgi-bin directory.        The first

: (so it will check in the current directory).

        Your script is *not* guaranteed to be executed in the same directory
        that it is stored in.  This is the case with IIS and Netscape, among
        others.  Thus, "." won't help here.

: Since it did, I went ahead and
: tried to add:
: use lib '.';

        use lib '/hard/code/the/full/path/to/cgi-bin';

        Or, use the FindBin module to do this on the fly (so if you move it
        you won't have to recode).

        FYI, there is also a compatibility mode of the CGI.pm module to
        act almost exactly like cgi-lib.pl to the point I think it is simply
        a one line change.  See 'perldoc CGI' for details.

--

BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".



Mon, 16 Apr 2001 03:00:00 GMT  
 Problem with "require"
What if you say
require "./cgi-lib.pl";
and also add -w to the first #! line.

Also try require "c:/the_full_path/cgi-lib.pl";

I'm not familiar with NT. It doesn't have anything like file permission, does it?
I mean do you have to chmod?

Yong



Mon, 16 Apr 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Problems with "require" in Perl 5

2. Problems with "require"

3. Problem with "require" in server

4. Help... I have a problem in "require"

5. use require ("or require use?");

6. non-fatal require "non-existant.pl"?

7. Run time use of "require".

8. Inlining "require" files

9. eval "require $class";

10. Unable to retain required "+" from STDIN

11. require, use and "scope"

12. Require "No NT commands" on UNIX

 

 
Powered by phpBB® Forum Software