Hello I was wondering if there is a way to read a unix profile'd variable while inside my PERL code?

I'm trying to do something like this.

system( " execute some code >> $UNIXVAR\log");

also tried

system( " execute some code >> '$UNIXVAR\log'");

I think though that the way I'm executing my application that I'm losing my profile's exported varibles.

I'm executing my app like this
This is on an AIX Unix environment if this helps anyone.

Edited by Dani: Fixed formatting

10 Years
Discussion Span
Last Post by subii P

Thanks for the quick reply, but that's not quite what I need.
I wasn't quite clear enough.
So for example say I export a path to a variable name then my perl script I want to access that path that is stored in the variable is there a way to access that?

From what I see from the $ENV variable options it holds a lot of information the system and unix environment but I do not see any profile/user variables in the list.


thanks for the help I didn't notice those were braces around the variable this is exactly what I needed



I am facing the same probelm, and i am not clear with the solution.
I wanted to read a unix PATH variable into perl script.


Can u help me in doing this.

Thanks in advance,

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.