Re: setting the environment variables in perl
From: Flemming Greve Skovengaard (dsl58893_at_vip.cybercity.dk)
Date: 07/27/04
- Next message: Bob Showalter: "RE: setting the environment variables in perl"
- Previous message: Paul Kraus: "Re: setting the environment variables in perl"
- In reply to: Paul Kraus: "Re: setting the environment variables in perl"
- Next in thread: Bob Showalter: "RE: setting the environment variables in perl"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 27 Jul 2004 16:58:28 +0200 To: "beginners@perl.org" <beginners@perl.org>
Paul Kraus wrote:
> You can access all the env variables like this...
>
> $ENV{ 'VAR' }
>
> example
> my $home = $ENV{ 'HOME' };
> print "$home\n";
>
> I have never tried to change them but I would assume
> that it would work.
>
> HTH,
> Paul Kraus
>
> On Tue, Jul 27, 2004 at 07:29:45AM -0700, jason corbett wrote:
>
>>How does one go about assuring that the environment variables are properly set in perl? I read several books, but none go in depth about how to write a script that includes all the required variables, that way nothing gets left out.
>>
>>Please advise.
>>
>>JC
>>
>>[snipet]
>>
>>
>>#!/usr/bin/perl -w
>>
>>$ENV{"ORACLE_HOME"}="/orav101/oracle/8.1.7";
>>
>>use strict;
>>use DBI;
>>use lib '/home/samcsm/jason/myperl/lib/perl5/site_perl/';
>>
>>
>
>
Use this one-liner to check your environment variables:
perl -Mstrict -we 'foreach my $key (sort keys %ENV) { print "$key =>
$ENV{$key}\n" }'
-- Flemming Greve Skovengaard The prophecy of the holy Norns a.k.a Greven, TuxPower the world is doomed to die <dsl58893@vip.cybercity.dk> fire in the sky 4112.38 BogoMIPS the end is coming soon
- Next message: Bob Showalter: "RE: setting the environment variables in perl"
- Previous message: Paul Kraus: "Re: setting the environment variables in perl"
- In reply to: Paul Kraus: "Re: setting the environment variables in perl"
- Next in thread: Bob Showalter: "RE: setting the environment variables in perl"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|