develooper Front page | perl.perl5.porters | Postings from October 1999

PERL_HEADER env varb: was: Addition to @INC

From:
Ed Peschko
Date:
October 20, 1999 21:15
Subject:
PERL_HEADER env varb: was: Addition to @INC
Message ID:
199910210411.XAA07351@foghorn.csgsystems.com
On Wed, Oct 20, 1999 at 03:24:01PM -0700, Randal L. Schwartz wrote:
>>>>>> "Ed" == Ed Peschko <Ed_Peschko@csgsystems.com> writes:
>
>Ed> How difficult would it be to add the path of the current working directory
>Ed> of the script itself into INC? I'm finding myself constantly doing the following
>Ed> hack:
>
>It cannot be done with certainty.  And yes, Tom's post shows that
>there already is a way to do it with some uncertainty.
>
>I would be opposed to putting it in because it's expensive to do,
>and not used for 99% of my programs. :)

*sigh*. Ok, your point is well taken, but sometimes I *really* wish that there 
was something like a PERL_HEADER variable in which you could put stuff like 
this, and which would be included at the beginning of each file. Yes, there 
would be a performance hit, and yes it has the potential to make things 
non-portable, but its really beginning to SUCK to have to add six+ lines at 
the beginning of every file just to get functionality that is so common but 
also site-specific. Stuff like:

use strict;
use DBI;
use FindBin;           
use lib $FindBin::Bin; 
use IO;
use Data::Dumper;
use Rebol;
use lib "put site specific libraries here"; 

And sometimes, I wish that there was a method for *compiling* these commonly
used modules into the interpreter itself, as part of Configure. I swear that 
having this feature would get rid of 60% of the 'should this functionality
be in the core' arguments that are on p5p.

Ed 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About