Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting %ENV% for my script

Status
Not open for further replies.

MoshiachNow

IS-IT--Management
Feb 6, 2002
1,851
IL
Hi,

for my perl program (uses wget command) to be able accessing WEB,I need to set the %ENV% at the beginning of the program,for my current environment.
However all the below methods I used did not do the trick.
Need your advise,thanks

Method 1:

open (FILE12,">$tempdir\\PROXY.bat");
print FILE12 "set HTTP_proxy=close FILE12;
system("$tempdir\\PROXY.bat");

Method 2:
system("set HTTP_proxy=

Long live king Moshiach !
 
Why use wget? The LWP suite of modules will allow you to do the same things without needing to shell out to external programs. Google for "lwpcook", which is the LWP cookbook. It has loads of solutions to common problems of this sort.
 
As for your original question, I think you should set %ENV% before you run perl.
Create a .bat file like this:

set HTTP_proxy=set <whatever else>
my_perl_prog.pl

hope this helps
 
Thanks,hoinz,I have figured this out as well.
However this is not goof for the way I currently activate the application,as one program ...
I was thinking of using the "env" module options:

env [name=value]... [command [args]...]

env HTTP_proxy= system("wget ....");

Have to test if it works yet.
thanks

Long live king Moshiach !
 
ishnid ,

Currently I use wget in background ,which enables me implementing a progress indicator.
If I use LWP,how would I get it running in background as well?
ince I have a Tk in the same program,I know that threading would not be a good idea,since these do not get along nicely.
thanks

Long live king Moshiach !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top