in reply to Splitting folded MIME headers into indivual headers?

What about good ol' line by line processing?

use strict; use warnings; use Data::Dumper; my $t = q{ Subject: Hi there Content-Type: text/plain; format=flowed; charset="iso-1189-1"; Return-Path: <example@example.org> }; my @fields; for ( split /\n/, $t ) { push @fields, $_ and next if /^\S+:/; $fields[-1] .= $1 if /\s*(.+)/; } print Dumper \@fields;