in reply to Re^7: Perl MIME
in thread Perl MIME - Open file
Hi Tux, once last question, the /data to open the text file, in my case is /mimex or is the \*STDIN ? just putting it all together , see below.... looks ok to you? Thanks so much!!!
#! /usr/bin/perl open FILE,">>/tmp/SRP_RMS.xlog"; print FILE "\nInitialising\n"; my $dbh = DBI->connect($dsn,$user,$pass) or die "Can't Connect to the DB: $DBI::errstr\n"; $indata=0; use MIME::Parser; $parser = new MIME::Parser; $output = "/tmp/mimex"; $parser->output_dir($output); my $entity = $parser->read(\*STDIN); open my $fh, "<", \$data; my $csv = Text::CSV_XS->new ({ binary => 1, auto_diag => 1 }); while (my $row = $csv->getline ($fh) { @$row or next; # skip empty lines if ($indata == 0) { @data = @$row; if ($row->[0] eq "Subject:") {
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: Perl MIME
by Tux (Canon) on Mar 22, 2012 at 15:53 UTC |