>>4815 mac HTTP::Response の code メソッドを使えばよいと思います。 ----- #!/usr/local/bin/perl use strict; use HTTP::Request::Common; use LWP::UserAgent; my $req = POST( 'http://X68000.q-e-d.net/~68user/net/sample/http-auth/secret.html'); $req->authorization_basic('hoge', 'wrong-password'); my $ua = LWP::UserAgent->new; my $res = $ua->request($req); print $res->code."\n"; my $req2 = POST( 'http://X68000.q-e-d.net/~68user/net/sample/http-auth/secret.html'); $req2->authorization_basic('hoge', 'fuga'); my $ua2 = LWP::UserAgent->new; my $res2 = $ua2->request($req2); print $res2->code."\n"; |