Return-Path: owner-new-httpd Received: by taz.hyperreal.com (8.6.10/8.6.5) id IAA01145; Fri, 26 May 1995 08:27:34 -0700 Received: from ooo.lanl.gov by taz.hyperreal.com (8.6.10/8.6.5) with ESMTP id IAA01138; Fri, 26 May 1995 08:27:30 -0700 Received: by ooo.lanl.gov (1.37.109.16/16.2) id AA284352003; Fri, 26 May 1995 09:26:43 -0600 From: Rob Hartill Message-Id: <199505261526.AA284352003@ooo.lanl.gov> Subject: Re: cwdir a part of CGI spec? To: new-httpd@hyperreal.com Date: Fri, 26 May 95 9:26:43 MDT In-Reply-To: ; from "Brian Behlendorf" at May 26, 95 12:06 (midnight) X-Organization: Theoretical Division, T-8. Los Alamos National Laboratory X-Snail: LANL Theoretical Divi' T-8, MS B285, P.O Box 1663, Los Alamos NM 87545 X-Marks-The-Spot: Doh ! X-Url: http://nqcd.lanl.gov/~hartill/ X-Cessive-Use-Of-Headers: check Mailer: Elm [revision: 70.85] Sender: owner-new-httpd@apache.org Precedence: bulk Reply-To: new-httpd@apache.org Brian B. wrote, > require "./common.pl" > > in script.cgi. With NetSite (and I'm sorry to single it out, Rob, I'm > sure others have this problem) I'd have to explicitly state > > require "/path/scripts/common.pl" > > which suddenly make my scripts a lot less portable. You can make your scripts more portable e.g. with unshift(@INC, $1) if __FILE__ =~ m#(.+)/#; This looks for a path in the script name, and if it finds one, it adds it to the default "INClude" path which "require" uses. I do this as standard practise for many of my perl scripts so that I can run them from the command line from anywhere. -- Rob Hartill http://nqcd.lanl.gov/~hartill/