Pan20 has asked for the wisdom of the Perl Monks concerning the following question:
#! /usr/bin/perl open FILE,">>/tmp/SRP_RMS.xlog"; print FILE "\nInitialising\n"; #filename = $ARGV[0]; my $dbh = DBI->connect($dsn,$user,$pass) or die "Can't Connect to the DB: $DBI::errstr\n"; #open FILE, $filename; $indata=0; #$csv = Text::CSV->new(); #$processed = 0; use MIME::Parser; $parser = new MIME::Parser; $output = "/tmp/mimex"; $parser->output_dir($output); my $entity = $parser->read(\*STDIN); my $num_parts = $entity->parts; if($num_parts > 0) { for(my $i = 0; $i < $num_parts;$i++) { my $part = $entity->parts($i); my $type = lc $part->mime_type; my $bh = $part->bodyhandle; print FILE "Type: ".$type."\n"; if($type eq 'text/plain') { print FILE "processing: ".$bh->{MB_Path}."\n"; open CSVFILE, "<$bh->{MB_Path}"; #$csv = Text::CSV->new(); #$processed = 0; while (<CSVFILE>) { $line = $_; if($line =~ /^$/) { } elsif ($indata ==0)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl MIME
by Tux (Canon) on Mar 15, 2012 at 14:33 UTC | |
by Pan20 (Novice) on Mar 16, 2012 at 00:11 UTC | |
by Tux (Canon) on Mar 16, 2012 at 07:39 UTC | |
by Pan20 (Novice) on Mar 21, 2012 at 23:19 UTC | |
by Tux (Canon) on Mar 22, 2012 at 07:44 UTC | |
| |
|
Re: Perl MIME
by molecules (Monk) on Mar 15, 2012 at 13:51 UTC |