Article View: csu.cs
Article #55perl require statement
From: Adam Carheden
Date: Mon, 03 Apr 2000 00:00
Date: Mon, 03 Apr 2000 00:00
17 lines
1324 bytes
1324 bytes
I've build a nice little library of perl routines for use in a web page I'm designing. It was all working nicely, adding them using the line require '../lib/functions.pl'; because the page generating script was in a sub directory. Then I added some stuff to one of the library files (functions.pl) in which IT used a require statement to include another file in the lib directory. require 'functions2.pl'; This doesn't work, of course, becuase the actual script run by the webserver is in /sitename/page.pl. When run from the command line, functions.pl works fine becuase it's in the same directory as functions2.pl. When called by the page.pl, perl looks for /sitename/functions2.pl and, of course, doesn't find it. Is there any way I can require functions2.pl in functions.pl without passing the location of page.pl to functions.pl as an argument?
Technical Details
Message-ID:
<38e8e402@news.ColoState.EDU>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 148df6,36240e54cecdbac1,start
X-Google-Attributes: gid148df6,public
From: Adam Carheden <carheden@holly.ColoState.EDU>
Subject: perl require statement
Date: 2000/04/03
Message-ID: <38e8e402@news.ColoState.EDU>
X-Deja-AN: 606175032
X-Trace: 3 Apr 2000 12:33:38 -0700, holly.acns.colostate.edu
User-Agent: tin/pre-1.4-19990517 ("Psychonaut") (UNIX) (AIX/4-3)
Newsgroups: csu.cs