How to print out content during the else condition?
That was in my edit2 section: else {die $response->status_line . ($response->content||'');}
Or, putting it into your whole script:
use strict; use warnings; use LWP::UserAgent(); my $ua = LWP::UserAgent->new(timeout => 10); $ua->env_proxy; my $response = $ua->get('https://www.sec.gov/Archives/edgar/full-index +/2019/QTR1/master.idx'); open(OUT, ">" . "master") or die "Cannot open master"; if ($response->is_success) {print OUT $response->decoded_content; } else {die $response->status_line . ($response->content||'');} close OUT;
In reply to Re^3: LWP and Mechanize
by pryrt
in thread LWP and Mechanize
by perlmike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |