There certainly is. Have a look at HTTP::Response, in particular the is_error and code methods.
In reply to Re: Capture HTTP Error in Perl by hippo in thread Capture HTTP Error in Perl by suzun30