# HG changeset patch # User Heiko Schlittermann (JUMPER) # Date 1325691716 -3600 # Node ID 13a91c6153319f91d30e14fb026ba7c9711a91a3 # Parent 7c3215a97e4b1713edb3d8f2385c84b2f7f5afd2 Backed out changeset 7c3215a97e4b will reactivate the add- and remove- header_line diff -r 7c3215a97e4b -r 13a91c615331 lib/Message/2822.pm --- a/lib/Message/2822.pm Fri Nov 25 15:44:37 2011 +0100 +++ b/lib/Message/2822.pm Wed Jan 04 16:41:56 2012 +0100 @@ -48,18 +48,18 @@ return join "" => @r; } -#sub remove_header_lines { -# my $self = shift; -# my $pattern = shift // die "Need a pattern!"; -# $DATA{header}{$self} =~ s/^$pattern.*?(?=^\S|\Z)//imsg; -#} +sub remove_header_lines { + my $self = shift; + my $pattern = shift // die "Need a pattern!"; + $DATA{header}{$self} =~ s/^$pattern.*?(?=^\S|\Z)//imsg; +} -#sub add_header_line { - #my $self = shift; - #my $_ = shift; - #$_ .= "\n" unless /\n$/; - #$DATA{header}{$self} .= $_; -#} +sub add_header_line { + my $self = shift; + my $_ = shift; + $_ .= "\n" unless /\n$/; + $DATA{header}{$self} .= $_; +} sub header_contents { my $self = shift; @@ -128,19 +128,19 @@ The construcor. The file is opened r/o and read. The file will not be closed until the object disappears. -=item B([I]) +=item @list = B([I]) Return a list of existing header fields, matching the pattern. See B for information about the returned format. (default pattern: /.*/) -=item B([I]) +=item @list = B([I]) Returns the header line matching the I. See B about the returned format. (default pattern: /.*/) -=item B([I]) +=item @list = B([I]) Returns the contents of the header lines matching the pattern. (default pattern: /.*/) @@ -153,13 +153,13 @@ since it is considered a part of the field name. I is case insensitive! -=item B() +=item $scalar = $B() -Returns the original header as it is in a single scalar. +Returns the original header as it is. -=item B() +=item $body = B() -Returns the original body as it is in a single scalar. +Returns the original body as it is. =back