Re: HTTP::Cookies destructor

Gisle Aas <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
On Wed, Feb 11, 2009 at 22:53, Zefram <[email protected]> wrote:
> I've found another patch, from around the same time, that I sent to you
> and isn't in the latest release.

This patch has now been applied as well.  Thanks!

http://gitorious.org/projects/libwww-perl/repos/mainline/commits/d697d6dafa3d9d55d6b9c048baf4eb3368524fb7

--Gisle


>                                             This is for HTTP::Cookies, in the LWP
> distribution.  The destructor for HTTP::Cookies can clobber $! and the
> other global status variables.  Destructors need to avoid this because
> they are called implicitly.  This patch fixes it:
>
> START_OF_PATCH
> --- libwww-perl-5.808.orig/lib/HTTP/Cookies.pm  2004-11-12 10:06:12.000000000 +0000
> +++ libwww-perl-5.808.mod0/lib/HTTP/Cookies.pm  2007-09-08 09:28:13.922627811 +0100
> @@ -507,6 +507,7 @@
>  sub DESTROY
>  {
>     my $self = shift;
> +    local($., $@, $!, $^E, $?);
>     $self->save if $self->{'autosave'};
>  }
>
> END_OF_PATCH
>
> -zefram
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.