Skip Menu |

This queue is for tickets about the Email-Received CPAN distribution.

Report information
The Basics
Id: 104756
Status: new
Priority: 0/
Queue: Email-Received

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

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



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
Simple reproducer: perl -e 'require Email::Received for 1' -- rjbs