rjbs / Email-MIME-ContentType

perl library for parsing content-type headers
5 stars 3 forks source link

Prevent warnings "Use of uninitialized value $_" #12

Closed phluks closed 7 years ago

phluks commented 7 years ago

I get these a lot in the TDC webmail server.

Best regards, Olav Cleemann

pali commented 7 years ago

_parse_attributes is private function for Email::MIME::ContentType module. It starts with underline, is undocumented and plus it is not exported (as it is private).

Why are you using it?

I'm not happy to see patch which adds some hack it just because somebody is trying to use undocumented module-private function.

phluks commented 7 years ago

Hi Pali

No need to jump to conclusions.

I'm not using the private method directly. It's just the method that gives me the warnings - hence the suggestion.

I'd be happy to see you impelement at better fix.

Best regards, Olav

pali commented 7 years ago

Basically _parse_attributes should not be called with undef... Do you have example input on which it is? If yes, then it is (different) bug and needs to be really fixed. But without testing example, it is hard to identify it.

phluks commented 7 years ago

Hi Pali

I stand corrected. It turns out that it was my assumptions that were at fault.

It is indeed an in-house wrapper module that calls _parse_attributes directly with the empty value. A well-placed "cluck" ferreted the miscreant out.

I'm sorry for the inconvenience. Please accept my apologies. I'll fix the offending module in stead.

Best regards, Olav