in reply to Re^5: MIME voodoo.
in thread MIME voodoo.
Ah! I see now - you're getting rid of the semicolon and everything that follows, so you're only left with text/plain or text/html. I see. :)
Any ideas why it only returns the plain text portion, and no html?
sub get_text_parts { my @parts = shift->parts; my %ct; # $ct{$_->content_type} = $_ for @parts; for (@parts) { (my $c = $_->content_type) =~ s/;.+//; # print "\nDEBUG: $c\n"; $ct{$c} = $_; } return $ct{'text/plain'} if exists $ct{'text/plain'}; return $ct{'text/html'} if exists $ct{'text/html'}; return $parts[0] if $which =~ /text/; return $parts[1] if $which =~ /html/; }
outputs:
$ ./grab.pl mime4 html line1 line2 line3 $ ./grab.pl mime4 text line1 line2 line3 $
I really appreciate you taking the time to help out, thanks a lot :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: MIME voodoo.
by ikegami (Patriarch) on Jul 16, 2009 at 20:39 UTC | |
by vxp (Pilgrim) on Jul 16, 2009 at 20:54 UTC | |
|
Re^7: MIME voodoo.
by zwon (Abbot) on Jul 16, 2009 at 20:40 UTC |