in reply to MIME::Parser and multi-line subjects
#!/usr/bin/perl use warnings; use strict; use Encode qw{ encode }; use LWP::Simple qw{ get }; use MIME::Parser; my $parser = 'MIME::Parser'->new; $parser->extract_uuencode(1); $parser->extract_nested_messages(1); $parser->output_to_core(1); my $email = encode('UTF-8', get('https://pastebin.com/raw/LRs9J4pd')); open my $f, '<', \$email or die $!; my $e = $parser->parse($f); print $e->head->get('Subject'); __END__ Output: [updates-announce] MGASA-2023-0355: New chromium-browser-stable 120.0.6099.129 fixes bugs and vulnerabilities
The problem is the code then processes the input file line by line. That's where the multiline subject is not processed correctly, I'd guess.
Update: It's hard to tell what exactly is the problem, as you didn't specify what error you got, and I'm not able to run your script without changes, as the Advisory module doesn't exist on CPAN.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: MIME::Parser and multi-line subjects
by gossamer (Sexton) on Dec 26, 2023 at 23:55 UTC |