in reply to trouble with MIME::Tools

Can you provide sample contents for $page or $email that cause the failure? A self contained example is much more likely to attract usefull answers than partial code that likely misses the crucial information - like that data being parsed in this case.

It may be worth checking that line endings are as you expect and that the character class is as you expect.


Perl is Huffman encoded by design.

Replies are listed 'Best First'.
Re^2: trouble with MIME::Tools
by lig (Acolyte) on Oct 24, 2005 at 12:29 UTC

    $page is strictly for display (use CGI module)

    $email is a string that holds the email message in it's entirty (verified earlier by being printed out). It was loaded using Net::POP3. Specifically with the get method.

    life is a game... so have fun.

      The following works for me. What's your beef? Give a similar example that doesn't work for you.

      use warnings; use strict; use MIME::Parser; my $email = 'Subject: none'; my $parser = new MIME::Parser; my $entity = $parser->parse_data ($email) or die "Bad Parse. "; my $subject = $entity->head->get ('subject', 0); my $crap = defined $subject?$ entity->head->get ('Subject', 0) : 'unde +­f'; print $crap;

      Perl is Huffman encoded by design.