Home: General Discussions: Tutorial/Article Suggestions for The Learning Cent:
How to set Perl Interpreter within perl script



SmallWonder
Novice

Apr 2, 2007, 7:45 AM


Views: 54798
How to set Perl Interpreter within perl script

 Hello Friends

I am new to this forum and this is my first post.

I im in big trouble.

I have to set some environment variables within perl script. and
after that i have to set a new perl interpreter for further action.

in detail:

first start the script with general interpreter
#!/usr/bin/perl

then set some environment variables

after that set a new interpreter which will be used for rest of the code.


Friends can you please Help me on this problem.

Thanks in advance.

Manish


hydpm
User

Jul 14, 2008, 11:44 AM


Views: 54020
Re: [SmallWonder] How to set Perl Interpreter within perl script

Hi manish,



In perl, we have a %ENV Hash variable , which is used to set the environment variables.

while(($k,$v) = each(%ENV)) {

print "$k \t";

print $ENV{$k},"\n";

}

The above prints all the environments variable and thier values.

If u want to modify particular one then make a if condition and perform your code.



Thanks

Raj