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

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


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

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

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


Site Timeline