Thanks. I see my error. I've modified the code and I can pull the proxy from the list but I'm getting the following error, "Proxy must be specified as absolute URI; '1.0.251.108:8080' is not at" with the code below:

open(my $fh, '<', 'cities.txt') or die $!; print $fh; open(my $prx, '<', 'proxies.txt') or die $!; print $prx; mkdir 'Bing', 0755; mkdir 'Bing/1Parsed/', 0755; mkdir 'Bing/1Parsed/Html/', 0755; chomp(my @cities = <$fh>); close($fh); chomp(my @prx = <$prx>); print $prx; close($prx); open($fh, '<', 'keywords.txt') or die $!; for my $city (@cities) { seek($fh, 0, 0); while (my $keywords = <$fh>) { chomp($keywords); print "$city $keywords\n"; my $xml1 = $link1 . $city ."+". $keywords . $link2 . $city ."+". $ +keywords . $link3; #my $xmla = $link3 . $row . ".com"; #my $xmlx = $link4 . $row; my $filename1 = "Bing/".($city)."_". ($keywords) . ".html"; open my $fh1, ">", $filename1 or die("Could not open file. $!"); #toggle proxy selection my $ua = LWP::UserAgent->new; $ua->agent('Mozilla/8.0'); for my $p (@prx){ print "Current proxy:$p\n"; $ua->proxy('http', $p); # Use this UA/Proxy to fetch something.... }

I've read the can LPW info but I can't see how to fix this.


In reply to Re^4: Can't call method "proxy" on an undefined value at by Anonymous Monk
in thread Can't call method "proxy" on an undefined value at by Anonymous Monk

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.