I downloaded the file using wget, getting:

$ wget -O - http://www.tau.ac.il/tau.pac --17:49:19-- http://www.tau.ac.il/tau.pac => `-' Resolving www.tau.ac.il... 132.66.16.6 Connecting to www.tau.ac.il[132.66.16.6]:80... connected. HTTP request sent, awaiting response... 200 OK Length: 1,187 [application/x-ns-proxy-autoconfig] 0% [ ] 0 --.--K/s +function FindProxyForURL(url, host) { if ((isInNet(myIpAddress(), "132.66.90.0", "255.255.254.0")) & +& !dnsDomainIs(host, "www.tau.ac.il")) { return "PROXY proxyslb.tau.ac.il:8080; " + "PROXY proxy.tau.ac.il:8080; " + "PROXY netcache.tau.ac.il:8080; " + "PROXY netcache2.tau.ac.il:8080; " + "PROXY proxym.tau.ac.il:8080; " + "PROXY 132.66.16.12:8080; " + "PROXY 132.66.16.34:8080; " + "PROXY 132.66.16.23:8080"; } else if (isInNet(host, "132.66.58.20", "255.255.255.255")) { return "PROXY proxym.tau.ac.il:8080"; } else if (isPlainHostName(host) || isInNet(host, "127.0.0.1", "255.255.255.255") || isInNet(host, "132.66.0.0", "255.254.0.0")) { return "DIRECT"; } else { return "PROXY proxyslb.tau.ac.il:8080; " + "PROXY proxy.tau.ac.il:8080; " + "PROXY netcache.tau.ac.il:8080; " + "PROXY netcache2.tau.ac.il:8080; " + "PROXY proxym.tau.ac.il:8080; " + "PROXY 132.66.16.12:8080; " + "PROXY 132.66.16.34:8080; " + "PROXY 132.66.16.23:8080"; } }

It is easy to read, so I think that once you know your IP address you can pick a proxy from the list by hand

Or you can write a script yourself to parse the pac file, at the moment I have no time to sketch one, sorry :-(

Update: see HTTP::ProxyAutoConfig

Update: try this and tell me if it works. It seems I can't use that proxy, so I couldn't make any test myself, apart from checking that it parses and runs correctly.

use HTTP::ProxyAutoConfig ; use LWP::Simple qw(&getstore $ua); + my $pac = new HTTP::ProxyAutoConfig("http://www.tau.ac.il/tau.pac"); + my $url='http://www.yahoo.com'; $ua->proxy(http => $pac->FindProxy($url)); + my $file='test.html'; print "success" if (getstore($url, $file));

Update: actually, that won't work, since you need to parse the return value from FindProxy and pass it to $ua->proxy only if it matches /PROXY: host:port/ (after cleaning up the PROXY: parts, of course). Unfortunately, I am having no luck in making this module work (the FindProxyForURL function doesn't get defined). I'll update the above script as soon as I make sense of the module...

Update: Ok, I checked with ptkdb and saw that:

Possible solutions:

Sorry, I can't help further :-(

Ciao!
--bronto


The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).
--John M. Dlugosz

In reply to Re: lwp proxy problem by bronto
in thread lwp proxy problem by dannoura

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.