Hi Tux, I was playing around with the code and now i have one set of data, currently stored in mimex, how can i get that data to make it run through the while loop below? basically, i want to be able to open and read the txt file created after it was parsed... use MIME::Parser; my $parser = new MIME::Parser; my $output = "/tmp/mimex"; $parser->output_dir($output); my $entity = $parser->read(\*STDIN); --> the file that appears in mimex.... Hi Tux, thanks for having a look. The problem that am facing is that i have this file that is sent from my email to the server. it has a number of different formats in it... like html/text , plain text etc . am interested in the text/plain format. Am using the Mime Parser to extract it from the mail and then want to convert it to csv ... to go through the loop... adn update my database...

currently when am running it i can see that is going to the point if($type eq 'text/plain') and stops, is not not giving me any errors or going through the rest of the code.... can you suggest me something different? thanks so much,,
use MIME::Parser; my $parser = new MIME::Parser; my $output = "/tmp/mimex"; $parser->output_dir($output); my $entity = $parser->read(\*STDIN); open CSVFILE $csv = Text::CSV->new(); $processed = 0; #print "test4\n"; while (<CSVFILE>) { $line = $_; if($line =~ /^$/) { } elsif ($indata ==0) { @data = split(/[| ]/,$line); if($data[0] eq 'Subject:') {

In reply to Re^4: Perl MIME by Pan20
in thread Perl MIME - Open file by Pan20

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.