Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > running dot files

Reply
Thread Tools

running dot files

 
 
heylow
Guest
Posts: n/a
 
      05-15-2007
Gurus,

I have a dot file that contains the following.


$pwd
/home/oracle
$cat .edp
export ORACLE_HOME=/home/oracle/product/10.2.0/db
export SID=EDP

I have one line perl script.

$cat 1.pl
#!/usr/local/bin/perl
.. ~/.edp

$./1.pl

syntax error at ./1.pl line 2, near "."
Execution of ./1.pl aborted due to compilation errors.


How to get rid of this error?

Thanks

 
Reply With Quote
 
 
 
 
usenet@DavidFilmer.com
Guest
Posts: n/a
 
      05-15-2007
On May 15, 12:05 pm, heylow <(E-Mail Removed)> wrote:
> export ORACLE_HOME=/home/oracle/product/10.2.0/db
> export SID=EDP


This is a shell environment configuration file. Perl doesn't grok
such a file. There are several possibilities to configure your
environment in Perl, including these:

You could source the file and then run the Perl program (all from a
bash script); the Perl program will inherit the shell's environment.
It's kinda ugly, but I do this with cron jobs - the cron invokes a
ksh, which sources the env and runs the Perl program.

Or you can import the settings using a module such as
Shell::EnvImporter (I've never tried this, but it looks like it ought
to do the trick):
http://search.cpan.org/~dfaraldo/She...EnvImporter.pm

Or you can configure the environment directly in the Perl program:
$ENV{'ORACLE_HOME'} = '/home/oracle/product/10.2.0/db';
$ENV{SID} = 'EDP';

--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)

 
Reply With Quote
 
 
 
 
heylow
Guest
Posts: n/a
 
      05-15-2007
On May 15, 3:16 pm, (E-Mail Removed) wrote:
> On May 15, 12:05 pm, heylow <(E-Mail Removed)> wrote:
>
> > export ORACLE_HOME=/home/oracle/product/10.2.0/db
> > export SID=EDP

>
> This is a shell environment configuration file. Perl doesn't grok
> such a file. There are several possibilities to configure your
> environment in Perl, including these:
>
> You could source the file and then run the Perl program (all from a
> bash script); the Perl program will inherit the shell's environment.
> It's kinda ugly, but I do this with cron jobs - the cron invokes a
> ksh, which sources the env and runs the Perl program.
>
> Or you can import the settings using a module such as
> Shell::EnvImporter (I've never tried this, but it looks like it ought
> to do the trick):
> http://search.cpan.org/~dfaraldo/She.../lib/Shell/Env...
>
> Or you can configure the environment directly in the Perl program:
> $ENV{'ORACLE_HOME'} = '/home/oracle/product/10.2.0/db';
> $ENV{SID} = 'EDP';
>
> --
> The best way to get a good answer is to ask a good question.
> David Filmer (http://DavidFilmer.com)



Thank you.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: what is the difference between the vb dot net and asp dot net Nathan Sokalski ASP .Net 11 08-14-2009 08:22 PM
Dot Net Project Execution without Dot Net and Framework.... krishnan ASP .Net Building Controls 0 01-07-2006 08:51 AM
Dynamically resize visible text and append dot dot dot (like gmail subject lines.. ) how to question? jawolter@gmail.com Javascript 6 12-12-2005 04:09 PM
volatile struct in dot h vs dot c Christopher M. Lusardi C Programming 3 05-15-2004 12:17 AM
To dot or not to dot? SamuŽl van Laere HTML 8 10-16-2003 02:55 PM



Advertisments