Ineffectual has asked for the wisdom of the Perl Monks concerning the following question:
foreach my $link (@all_links) { my $link_url = $link->url; next unless ( $link_url =~ /http/ ); next if ( $link_url =~ /$url_root/ ); warn $link_url."\n"; my $out = $browser->get($link_url); #$success is 1 if a successful HTTP status code (2xx) +is returned my $success = $out->is_success; ok($success, "is_success"); #redirect is 1 if a redirection HTTP status code (3xx) + was returned #if a redirect is seen, may need to change link to a n +ew url my $redirect = $out->is_redirect; ok(!$redirect, "! is_redirect"); my $error=$out->is_error; #print errors if($error){ my $status = $out->error_as_HTML; warn "The error is:\n$status\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Mechanize and PDF files
by Fletch (Bishop) on Mar 12, 2010 at 21:15 UTC | |
by lostjimmy (Chaplain) on Mar 12, 2010 at 21:29 UTC | |
by Ineffectual (Scribe) on Mar 12, 2010 at 21:31 UTC | |
|
Re: WWW::Mechanize and PDF files
by lostjimmy (Chaplain) on Mar 12, 2010 at 21:11 UTC |