Re: Perl on Win32, with Apache

From: gnu valued customer (tlviewer_at_yahoo.com)
Date: 03/05/04

  • Next message: Bob Dubery: "Is it possible to impose a timeout on <>?"
    Date: Fri, 05 Mar 2004 08:32:01 GMT
    
    

    hello,
    "Regent" <arthur0421@163.com> wrote in message
    news:c29c2d$1pkd$1@mail.cn99.com...
    > I have a Perl-based web site, of which each script must "require" a
    > commonstuff.pl that simply defines some common subroutines and
    > constants. If I don't put commonstuff.pl in any of the @INC paths, how
    > should I efficiently include it in each script, avoiding such lines as
    >
    > require "d:/wwwroot/cgi-bin/commonstuff.pl";
    >
    > Of course I also tried the following:
    >
    > unshift (@INC, "d:/wwwroot/cgi-bin");
    > require ("commonstuff.pl");
    >
    > However I hate to do such path-specific things in the many scripts.
    Thanks!
    >
    > Regent

    use File::Basename;
    chdir(dirname( $0 ));
    require("commonstuff.pl");

    No hard-coded path here, so it might be what you want.

    good luck,
    Mark


  • Next message: Bob Dubery: "Is it possible to impose a timeout on <>?"

    Relevant Pages

    • Re: Perl on Win32, with Apache
      ... "Regent" wrote in message ... > should I efficiently include it in each script, ...
      (comp.lang.perl.misc)
    • Perl on Win32, with Apache
      ... I have a Perl-based web site, of which each script must "require" a ... should I efficiently include it in each script, ... Regent ...
      (comp.lang.perl.misc)