Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 39852
Status: resolved
Priority: 0/
Queue: libwww-perl

Owner: Nobody in particular
Requestors: adamk [...]

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: (no value)

Subject: HTTP::Message - CPU wasted by handling DESTROY in AUTOLOAD
Download (untitled) / with headers
text/plain 401b
In HTTP::Message, DESTROY is currently being handled in AUTOLOAD, which imposes a needless "return if $method eq "DESTROY";" call in every AUTOLOAD method, and a needless "my $method = substr($AUTOLOAD, rindex($AUTOLOAD, '::')+2);" variable allocation in every DESTROY call. A minor speed increase in both DESTROY and autoloaded calls could be gained by adding a simple line. sub DESTROY { return }
Download (untitled) / with headers
text/plain 722b
commit 6a90a5d24dd46f2c438199782fea8e35cd23966f Author: Gisle Aas <> Date: Tue Oct 7 10:08:24 2008 +0200 Avoid invoking AUTOLOAD on object destruction [RT#39852] diff --git a/lib/HTTP/ b/lib/HTTP/ index 618acab..8f24b3d 100644 --- a/lib/HTTP/ +++ b/lib/HTTP/ @@ -403,7 +403,6 @@ sub _stale_content { sub AUTOLOAD { my $method = substr($AUTOLOAD, rindex($AUTOLOAD, '::')+2); - return if $method eq "DESTROY"; # We create the function here so that it will not need to be # autoloaded the next time. @@ -413,6 +412,9 @@ sub AUTOLOAD } +sub DESTROY {} # avoid AUTOLOADing it + + # Private method to access members in %$self sub _elem {

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to