Skip Menu |

This queue is for tickets about the MIME-Lite-HTML CPAN distribution.

Report information
The Basics
Id: 29033
Status: resolved
Priority: 0/
Queue: MIME-Lite-HTML

People
Owner: Nobody in particular
Requestors: rjbs [...] cpan.org
Cc:
AdminCc:

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



Subject: eliminate nested subs
The "parse" method has several subroutines defined within its body, like this: sub parse { my $self = shift; ... sub pattern_image { $self->{x] = $_[0]; } } This mistake often indicates that the author thought it would mean that "pattern_image" was only callable from within parse. This is not the case: it is available globally and at compile-time. Further, it will be closed over any variables it uses but that are defined externally. Effectively, this means that a call to MIME::Lite::HTML::pattern will operate on the last object handled by the parse method, if called outside of parse. Nested subs are basically guaranteed to always be a mistake. -- rjbs
Fixed in 1.23