in reply to Re^5: Read UNIX environment variable
in thread Read UNIX environment variable
The function returns a hash. What you do with that hash is up to you. You haven't shown your program, so I can only give you general advice.
One approach would be to set up %ENV with the newly found values. Another one would be to merge %ENV with the newly found values, as you (and the example) show. A third approach would be to keep the two sets of values separate.
To simulate running under the login environment as closely as possible, %ENV = get_login_env() will certainly do that, but in the process, you lose any indication that your program is running as cron job. In general, I think the approach of merging %ENV and the values from the login environment, with the values from the login environment taking precedence is a good one.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Read UNIX environment variable
by Anonymous Monk on Feb 09, 2011 at 13:55 UTC | |
by Corion (Patriarch) on Feb 09, 2011 at 14:32 UTC | |
by Anonymous Monk on Feb 09, 2011 at 14:48 UTC | |
by Corion (Patriarch) on Feb 09, 2011 at 14:52 UTC | |
by Anonymous Monk on Feb 09, 2011 at 15:15 UTC |