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

Re: Perl/Bash Common Variable Question

Thread Previous
From:
François Désarménien
Date:
November 21, 1999 08:36
Subject:
Re: Perl/Bash Common Variable Question
Message ID:
38382DE5.77E83A23@club-internet.fr

Not quite the right place for this question. Better ask in comp.lang.perl.*.

> However, the variables are not available in the shell script.  Is there
> a way to have these variables available in my shell script also?
> 
However, perldoc perlvar:

       %ENV  
       $ENV{expr}
                The hash %ENV contains your current environment.
                Setting a value in ENV changes the environment for
                child processes.                                                 

> Another question!  Before I can have access to the routines in
> 'initialize.sub', I have to copy 'initialize.sub' to
> /usr/lib/perl5/5.00503/i386-linux.  I believe that this is because I do
> not have something setup correctly in my perl installation, but I do not
> know what.  Any ideas?  I want to keep 'initialize.sub' in the same
> directory as the perl script
Your friends are perldoc perlvar:

       @INC    The array @INC contains the list of places to look
               for Perl scripts to be evaluated by the do EXPR,
               require, or use constructs.  It initially consists               
               of the arguments to any -I command line switches,
               followed by the default Perl library, probably
               /usr/local/lib/perl, followed by ".", to represent
               the current directory.  If you need to modify this
               at runtime, you should use the use lib pragma to
               get the machine-dependent library properly loaded
               also:
 
                   use lib '/mypath/libdir/';
                   use SomeMod;                                                 

and perldoc lib:

NAME
       lib - manipulate @INC at compile time
 

François

Thread Previous


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