RE: Odd warning w/ Mail::Header

Brian Raven <[email protected]> Wed, 12 Sep 2012 09:55:19 +0000
Newsgroups gmane.comp.lang.perl.active-perl
Message-ID <[email protected]>
> -----Original Message-----
> From: [email protected] [mailto:activeperl-
> [email protected]] On Behalf Of Philip Prindeville
> Sent: 12 September 2012 00:11
> To: [email protected]
> Subject: Odd warning w/ Mail::Header
>
> I'm running ActiveState Perl 5.14_02 on Win7 x64.
>
> I'm seeing:
>
> C:\Users\philipp\Desktop\scayl\agent\trunk\tests>perl test001.pl Can't
> use string ("From") as an ARRAY ref while "strict refs" in use at
> C:/Perl64/site/lib/Mail/Header.pm line 278.
> C:\Users\philipp\Desktop\scayl\agent\trunk\tests>
>
> The $VERSION of Header.pm is 2.11.
>
> The line in question is:
>
>      while(@$lines && $lines->[0] =~ /^($FIELD_NAME|From )/o)
>
> I'm a little boggled by this warning.  Anyone else seen it?
>
> I do no see this on Linux or MacOS with Perl 5.10 or 5.12,
> respectively.

That line is in the extract function. You don't show any of your code, but the error message suggests that extract is being called with a string containing "From", or possibly an array whose first entry is "From", rather than an array ref, which it is clearly expecting.

Clearly, that is, from the code rather than (IMHO) the documentation which just says array. If you think it important enough, feel free to suggest changes to the module's maintainer. Clarifying the documentation, and perhaps some parameter validation, may make it easier to use the module as intended.

HTH

--
Brian Raven





________________________________

Please consider the environment before printing this e-mail.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs