Subject: | <DATA> should localize $_ first |
Today, I had to change where I load Email::Received.
Its parse_rules does this:
sub parse_rules {
...
while (<DATA>) {
...
parse_rules is called when the library is loaded. It might be loaded dynamically during some other code, and, in fact, that's what happened. The other code had topicalized to something read only.
for (1) {
while (<DATA>) { ... }
}
The above dies when the implicit assignment to $_ fails because 1 is a read-only value.
I've moved the load, but at the least, parse_rules should localize $_.
A comment in the code reads:
# So the plan - man, this is so evil - is to make parse_received on the
# fly from the rules below.
*parse_received = generate_parse_received( unparse_rules(parse_rules()));
I would be happy to sort out that evil and replace it with precompiled rules built at CPAN upload time. Let me know if you'd like me to take up maintenance of this code. I know you're not doing much CPAN stuff these days.
--
rjbs