Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Help needed on HTTP redirects

by Mr_Jon (Monk)
on Aug 04, 2004 at 17:31 UTC ( [id://380052]=note: print w/replies, xml ) Need Help??


in reply to Help needed on HTTP redirects

To differentiate HTTP responses with a bit more granularity, use $response->code or $response->status_line:
#! usr/bin/perl -w use strict; use LWP::UserAgent; $\ = "\n"; my $ua = LWP::UserAgent->new; my $response = $ua->get('http://www.perlmonks.org'); print $response->code; print $response->status_line; # or more generally... print "Success" if $response->is_success; print "Error" if $response->is_error; print "Info" if $response->is_info; print "Redirect" if $response->is_redirect;
See the docs on LWP::UserAgent and HTTP::Response for more detail.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://380052]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-03-29 06:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found