I am learning how to use the various classes of MIME::Tools. I am getting the hang of it but have recently run into a wall. I am trying to get the Subject header just to display - and it is a no go.

I have made sure to have "use" on all of the modules involved (Parser, Entity, and Head). running with strict, warnings and diagnostics. Nothing in the error logs.

Can anyone see where I am going wrong? I have commented out the the alternate code (though not all of it's variations) I attempted to use so you can see the alternate path I tried.

eval { # OK here is where we will try to use the MIME::Tools suite of clas +ses # Wish me luck - Hopefully I won't screw it up too much. my $parser = new MIME::Parser; my $entity = $parser->parse_data($email) or die("Bad Parse. "); # Tried this - doesn't work #my $crap = (defined($entity->head->get('subject',0)))?$entity->hea +d->get('Subject',0):'undef'; #$page->p("Subject: $crap<br />\n"); # Also tried this - doesn't work $page->p('Subject: '.$entity->head->get('subject',0)); # The wierd part - this does work. Even when the other # parts are still in $page->p($entity->head->print()); }; if ($@) { print $page -> p("Error occured $@ \n"); }
Update: Solved.

I am an idiot. Finally figured out what was going wrong. I forgot to print the stupid $page->p. Just shoot me

life is a game... so have fun.

In reply to trouble with MIME::Tools by lig

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.