-sub new {
- my ($class, $raw, $href) = @_;
-
- # we never care about trailing whitespace
- $raw =~ s/\s*\z//;
- bless {
- raw => $raw,
- href => defined $href ? $href : $raw,
- }, $class;
-}
-
-sub new_msgid {
- my ($class, $msgid) = @_;
- $class->new($msgid, mid_escape($msgid));
-}
-
-sub new_oneline {
- my ($class, $raw) = @_;
- $raw = '' unless defined $raw;
- $raw =~ tr/\t\n / /s; # squeeze spaces
- $raw =~ tr/\r//d; # kill CR
- $class->new($raw);
-}