Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > persistant environment data

Reply
Thread Tools

persistant environment data

 
 
sburg
Guest
Posts: n/a
 
      09-23-2003
I am trying to convert the following line from a makefile into perl:
.. shell_script_to_get_env_data && java Main

When run on a Unix command line the
.. shell_script_to_get_env_data
sets some env variables.

Then some objects instantiated from Main.java need to use
those env variables.

The following perl lines don't work:
system(". shell_script_to_get_env_data");
system("java Main");
Main fails because its shell doesn't have the env variables set.

How do I put these commands together in Perl so that the environment
variables set up by the shell script are accessable by the Java
program?

Thanks,
Shawna
 
Reply With Quote
 
 
 
 
Vlad Tepes
Guest
Posts: n/a
 
      09-23-2003
sburg <> wrote:

> I am trying to convert the following line from a makefile into perl:
> . shell_script_to_get_env_data && java Main
>
> When run on a Unix command line the
> . shell_script_to_get_env_data
> sets some env variables.
>
> Then some objects instantiated from Main.java need to use
> those env variables.
>
> The following perl lines don't work:
> system(". shell_script_to_get_env_data");
> system("java Main");
> Main fails because its shell doesn't have the env variables set.
>
> How do I put these commands together in Perl so that the environment
> variables set up by the shell script are accessable by the Java
> program?


How about

system("./shell_script_to_get_env_data && java Main");

Or you could set the environment in perl, then run java:

$ENV{myvar} = "somevalue";
system("java Main");

--
Vlad
 
Reply With Quote
 
 
 
 
Chris Mattern
Guest
Posts: n/a
 
      09-23-2003
sburg wrote:
> I am trying to convert the following line from a makefile into perl:
> . shell_script_to_get_env_data && java Main
>
> When run on a Unix command line the
> . shell_script_to_get_env_data
> sets some env variables.
>
> Then some objects instantiated from Main.java need to use
> those env variables.
>
> The following perl lines don't work:
> system(". shell_script_to_get_env_data");
> system("java Main");
> Main fails because its shell doesn't have the env variables set.
>
> How do I put these commands together in Perl so that the environment
> variables set up by the shell script are accessable by the Java
> program?
>

Have you tried
system(". shell_script_to_get_env_data && java Main");
?

Chris Mattern

 
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
Persistant cookies and non-persistant cookies. archana ASP .Net 1 05-25-2007 08:43 AM
persistant cookie, what is it? Edwin Knoppert ASP .Net 15 01-31-2006 10:07 PM
persistant datalayer across http requests? me ASP .Net 2 07-11-2004 06:38 PM
IP Regex and persistant datagrids Wayne M J ASP .Net 3 06-11-2004 10:58 PM
Autofresh and persistant checkboxes Paul ASP .Net 1 11-06-2003 09:05 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57