CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [digioleg54] How can I read UNIX nvironment varaibles in Perl script?: Edit Log



FishMonger
Veteran / Moderator

Oct 26, 2017, 9:10 AM


Views: 13859
Re: [digioleg54] How can I read UNIX nvironment varaibles in Perl script?

If perlenv_add.pl is not in the same directory as myApp.pl, then you could add a use lib statement.


Code
#!/usr/bin/perl 

use warnings;
use strict;
use lib '/path/to/environment-script(s)';
do 'perlenv_add.pl';

print "\nThis is you application speaking\n";
print "ORACLE_USER = $ENV{ORACLE_USER}\n";


Or, just add the path to the do statement.

Code
do '/path/to/perlenv_add.pl';



(This post was edited by FishMonger on Oct 26, 2017, 9:13 AM)


Edit Log:
Post edited by FishMonger (Veteran) on Oct 26, 2017, 9:10 AM
Post edited by FishMonger (Veteran) on Oct 26, 2017, 9:13 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives