Expanding Environment Variable

I got a question regarding environment variable:-

Page 1 of 1

3 Replies - 3257 Views - Last Post: 25 June 2009 - 03:40 AM

#1 Sun751  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 57
  • Joined: 11-December 08

Expanding Environment Variable

Post icon  Posted 25 June 2009 - 02:16 AM

In my config file I have $ENV(appl) assigned to some variable. And I am running the Perl script to read that config file (update few records, expand environment variable) then write it to some output file,

could any one guide me how can I expand that environment
variable? through my perl script,

For example in my config file:

Id = $ENV{APPL}

but while writing to output file I want,

Id = '/ann/dev/sum' [content of $ENV{APPL}]

Any Suggestion, Please

Cheers

This post has been edited by Sun751: 25 June 2009 - 03:56 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Expanding Environment Variable

#2 Sun751  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 57
  • Joined: 11-December 08

Re: Expanding Environment Variable

Posted 25 June 2009 - 02:22 AM

Need Help, Please

This post has been edited by Sun751: 25 June 2009 - 03:34 AM

Was This Post Helpful? 0
  • +
  • -

#3 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5363
  • View blog
  • Posts: 27,325
  • Joined: 10-May 07

Re: Expanding Environment Variable

Posted 25 June 2009 - 02:25 AM

** Topics Merged **
Was This Post Helpful? 0
  • +
  • -

#4 chorny_cpan  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 52
  • Joined: 13-May 09

Re: Expanding Environment Variable

Posted 25 June 2009 - 03:40 AM

my $id = "/ann/dev/sum$ENV{APPL}";

Consider reading "Learning Perl" (no earlier than 4th edition) or "Beginning Perl" - they both have good exercises.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1