For Programmers: Free Programming Magazines  


Home > Archive > LibWWW > September 2007 > HTTP::Cookies destructor









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author HTTP::Cookies destructor
Zefram

2007-09-08, 8:14 am

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com