Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 73619
Status: rejected
Priority: 0/
Queue: Email-Simple

People
Owner: Nobody in particular
Requestors: brian [...] interlinx.bc.ca
Cc:
AdminCc:

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



Subject: Can't use string ("Received: from deliver ([unix so") as a HASH ref while "strict refs" in use at /usr/share/perl5/Email/Simple.pm line 100, <STDIN> line 76.
When I try to use Email::Simple to parse a mail message from my mailbox with the sample program: use Email::Simple; my $email = Email::Simple->new(<STDIN>); my $from_header = $email->header("From"); print $from_header, '\n'; I get the following error: Can't use string ("Received: from deliver ([unix so") as a HASH ref while "strict refs" in use at /usr/share/perl5/Email/Simple.pm line 100, <STDIN> line 76. The header line that it appears to be choking on is: Received: from deliver ([unix socket]) by linux.interlinx.bc.ca (Cyrus v2.4.12-Debian-2.4.12-1~lucid0) with LMTPA; Fri, 30 Dec 2011 08:14:25 -0500
Subject: Re: [rt.cpan.org #73619] Can't use string ("Received: from deliver ([unix so") as a HASH ref while "strict refs" in use at /usr/share/perl5/Email/Simple.pm line 100, <STDIN> line 76.
Date: Fri, 30 Dec 2011 08:51:26 -0500
To: "brian [...] interlinx.bc.ca via RT" <bug-Email-Simple [...] rt.cpan.org>
From: Ricardo Signes <rjbs [...] cpan.org>
* "brian@interlinx.bc.ca via RT" <bug-Email-Simple@rt.cpan.org> [2011-12-30T08:46:04] Show quoted text
> my $email = Email::Simple->new(<STDIN>);
->new wants to receive one string. <STDIN>, there, is passing a list of lines. You need to read the whole thing first, then parse that. Try: my $input = do { local $/; <STDIN> }; my $email = Email::Smple->new($input); Let me know if that helps. The error message you got stinks, though. -- rjbs
From: brian [...] interlinx.bc.ca
On Fri Dec 30 08:51:53 2011, RJBS wrote: Show quoted text
> > ->new wants to receive one string. <STDIN>, there, is passing a list > of lines.
Ahhh. Right. Show quoted text
> You need to read the whole thing first, then parse that. Try: > > my $input = do { local $/; <STDIN> }; > my $email = Email::Smple->new($input);
Or: @msg = <STDIN> my $email = Email::Simple->new(join('', @msg)); since I am already reading into @msg. Show quoted text
> Let me know if that helps.
It does, thanks much. Show quoted text
> The error message you got stinks, though.
Yeah, not terribly helpful. Sorry for the "noise".