use Win32::Registry; use Win32::API::Prototype; my $infile = "c:\\proxies.txt"; open (PFILE, $infile) || die "cannot Open $infile: $!"; my @proxies = (); my $proxy; foreach $proxy (@proxies){ my $Register = "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"; my $hkey; $HKEY_CURRENT_USER->Open($Register,$hkey)|| die $!; undef $garbage; $hkey->SetValueEx("ProxyServer",$garbage,REG_SZ,$proxy); $hkey->Close(); print "Current: $proxy\n"; ApiLink( "wininet", "BOOL InternetSetOption( HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength )" ) || die; InternetSetOption(NULL, INTERNET_OPTION_REFRESH , NULL, 0); sleep(30); }