#! /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)
In reply to Perl MIME - Open file by Pan20
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |