in reply to MIME::Parser and multi-line subjects

MIME::Parser handles multiline subjects just fine.
#!/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.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: MIME::Parser and multi-line subjects
by gossamer (Sexton) on Dec 26, 2023 at 23:55 UTC
    That was very helpful, thanks. The "Advisory" module is one I created that manages the database portion of this.

    I was able to rework the script to check the $subject itself after stripping off the carriage return at the end. I didn't realize $subject did indeed contain the whole line, but it also contained the carriage return.