So we're using LWP to pull data off a server by pretending we're a browser and going through a proxy--or we were, until firewall issues cut us off. They've added us to the allow list and should be getting through, but we're not.
"Okay," I says to myself, "if we can't go through the proxy 'cause it thinks we're it instead of us, I can just take the proxy setting out, and the request will just whiz right through."
Instead, now the script dies while I'm stepping through it in the debugger. This bothers me.
my $list_request = HTTP::Request->new(GET => $source_dir);
my $agent = LWP::UserAgent->new;
$agent->protocols_allowed(['ftp', 'http']);
#$agent->proxy('ftp' => 'http://www.nunya.biz:8080');
my $list_response = $agent->request($list_request);
my @lines = grep (s!^<A HREF="^\w+($loaddate)($file_pattern)([\w.]*).*
+$!$2$3!, (split(/\n/,$list_response->content)) );
Now, with the proxy setting taken out, it fails in the debugger on the next line.
I'm puzzled--any help?
adamsj
They laughed at Joan of Arc, but she went right ahead and built it. --Gracie Allen
In reply to LWP oddity
by adamsj
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.