Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi All, someone here kindly helped me with some code a few weeks ago to use when parsing emails to get the subject/from/body of an email .. I have the code, but it seems to be bringing up errors all the time, can anyone see any problems in this code?
Here is the errors:
Any ideas on what the problem could be?, Thank you so much
use MIME::Parser; use Mail::Address; $parser = new MIME::Parser; eval { $MIME_entity = $parser->parse(\*STDIN); } if ($@){ print 'Trouble parsing mail:'; print $parser->results->msgs(); } $header = $MIME_entity->head(); $subject = $header->get('Subject'); my $from = $header->get('From'); my @from_addresses = Mail::Address->parse($from); my $address; if (@from_addresses) { $address = $from_addresses[0]->address(); } else { print "No address found in from line!\n"; } $bodyh = $ent->bodyhandle; } $parser->filer->purge();
Here is the errors:
syntax error at email.pl line 47, near "){" syntax error at email.pl line 50, near "}"
Any ideas on what the problem could be?, Thank you so much
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: MIME Errors
by arhuman (Vicar) on Nov 23, 2001 at 15:23 UTC | |
by Anonymous Monk on Nov 23, 2001 at 15:29 UTC | |
Re: MIME Errors
by dws (Chancellor) on Nov 23, 2001 at 15:29 UTC | |
by Anonymous Monk on Nov 23, 2001 at 15:41 UTC | |
by McD (Chaplain) on Nov 23, 2001 at 22:20 UTC | |
by Anonymous Monk on Nov 23, 2001 at 18:13 UTC | |
by davorg (Chancellor) on Nov 23, 2001 at 18:21 UTC | |
by Anonymous Monk on Nov 23, 2001 at 18:35 UTC |
Back to
Seekers of Perl Wisdom