in reply to Re^3: Perl MIME
in thread Perl MIME - Open file
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:') {
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Perl MIME
by Tux (Canon) on Mar 22, 2012 at 07:44 UTC | |
by Pan20 (Novice) on Mar 22, 2012 at 12:11 UTC | |
by Tux (Canon) on Mar 22, 2012 at 12:25 UTC | |
by Pan20 (Novice) on Mar 22, 2012 at 13:49 UTC | |
by Tux (Canon) on Mar 22, 2012 at 15:53 UTC |