MIME::Head subsequent calls in a loop return empty values

E

ebg005

Hi,

To read SMTP message header fields of multiple messages (in Maildir),
I have a foreach loop which is doing subsequent calls to the sub
routine below. The first call is OK and returns the from and the to
field in a hash (called by reference), but successive calls to the
same readHeader routine returns me no values into my hash and gives no
error.

sub readHeader ($$) {
my ( $headRef, $msgFile ) = @_;
# get header fields
my $head = MIME::Head->from_file ( $msgFile );
$headRef->{from} = lc $head->get ( 'From' );
$headRef->{to} = lc $head->get ( 'To' );
}

I'm using the MIME-tools-5.425.
All ideas are welcome.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top