[EMAIL PROTECTED] (Randal L. Schwartz) writes:

> Doh!  When did *that* sneak in there!

I don't really know.  I guess you could dig in the CVS repository if
you really want to know.  There is an entry in the change log for
release 5.18 (1997-12-12) that says:

   Documented HTTP::Response->status_line method

> And why isn't the rest of the code using that? :)

Probably because it was written before that method showed up.  The
status line printed by as_string is also slightly different.

Somewhat related:  Based on a suggestion by Sean I would like to make
the all the 'is_*' methods return the status_line when TRUE.  Does
anybody have a better suggestion for what a useful TRUE value could
be?

That should allow you to write code like this:

   $res = $ua->get($url);
   if (my $err = $res->is_error) { die $err }

instead of:

   $res = $ua->get($url)
   if ($res->is_error) { die $res->status_line }

Not really a huge win, but it does get rid of 1 method call.

Regards,
Gisle

Reply via email to