diff options
| author | fukachan <fukachan> | 2003-02-11 12:10:11 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-02-11 12:10:11 +0000 |
| commit | e98aab3cd2d4393130a2570693091862c33273bf (patch) | |
| tree | 574e12d6a4289363794af98b78d37ab6cd63a7b9 /fml/lib/Mail/ThreadTrack | |
| parent | 87e1c89d1d95eed06dc7cba9a3245490e5ab9981 (diff) | |
| download | fml8-e98aab3cd2d4393130a2570693091862c33273bf.tar.gz fml8-e98aab3cd2d4393130a2570693091862c33273bf.tar.bz2 fml8-e98aab3cd2d4393130a2570693091862c33273bf.zip | |
FNF: not use $_
Diffstat (limited to 'fml/lib/Mail/ThreadTrack')
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/Print/Message.pm | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/fml/lib/Mail/ThreadTrack/Print/Message.pm b/fml/lib/Mail/ThreadTrack/Print/Message.pm index f93b6d2e..7c61a63a 100644 --- a/fml/lib/Mail/ThreadTrack/Print/Message.pm +++ b/fml/lib/Mail/ThreadTrack/Print/Message.pm @@ -1,10 +1,10 @@ #-*- perl -*- # -# Copyright (C) 2001,2002 Ken'ichi Fukamachi +# Copyright (C) 2001,2002,2003 Ken'ichi Fukamachi # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Message.pm,v 1.8 2002/09/22 14:57:07 fukachan Exp $ +# $FML: Message.pm,v 1.9 2002/12/22 03:19:15 fukachan Exp $ # package Mail::ThreadTrack::Print::Message; @@ -43,7 +43,7 @@ sub message_summary { my ($self, $file) = @_; my (@header) = (); - my $buf = ''; + my $msgbuf = ''; my $line = $self->{ _article_summary_lines } || 3; my $mode = $self->get_mode || 'text'; my $padding = $mode eq 'text' ? ' ' : ''; @@ -52,32 +52,34 @@ sub message_summary my $fh = new FileHandle $file; if (defined $fh) { + my $buf; + LINE: - while (<$fh>) { + while ($buf = <$fh>) { # remove useless lines - next LINE if /^\>/o; - next LINE if /^\-/o; + next LINE if $buf =~ /^\>/o; + next LINE if $buf =~ /^\-/o; # header part - if (1 ../^$/o) { - push(@header, $_); + if (1 .. $buf =~ /^$/o) { + push(@header, $buf); } # body part else { - next LINE if /^\s*$/o; + next LINE if $buf =~ /^\s*$/o; # ignore mail header like patterns. - next LINE if /^X-[-A-Za-z0-9]+:/io; - next LINE if /^Return-[-A-Za-z0-9]+:/io; - next LINE if /^Mime-[-A-Za-z0-9]+:/io; - next LINE if /^Content-[-A-Za-z0-9]+:/io; - next LINE if /^(To|From|Subject|Reply-To|Received):/io; - next LINE if /^(Message-ID|Date):/io; + next LINE if $buf =~ /^X-[-A-Za-z0-9]+:/io; + next LINE if $buf =~ /^Return-[-A-Za-z0-9]+:/io; + next LINE if $buf =~ /^Mime-[-A-Za-z0-9]+:/io; + next LINE if $buf =~ /^Content-[-A-Za-z0-9]+:/io; + next LINE if $buf =~ /^(To|From|Subject|Reply-To|Received):/io; + next LINE if $buf =~ /^(Message-ID|Date):/io; # pick up effetive the first $line lines - if (_is_valid_buf($_)) { + if (_is_valid_buf($buf)) { $line--; - $buf .= $padding. $_; + $msgbuf .= $padding . $buf; } last LINE if $line < 0; @@ -89,7 +91,7 @@ sub message_summary # XXX-TODO: WHO CARE FOR CSS ? return raw messages from here. # XXX-TODO: care for non Japanese. if (defined $self->{ _no_header_summary }) { - return STR2EUC( $buf ); + return STR2EUC( $msgbuf ); } else { use Mail::Header; @@ -98,7 +100,7 @@ sub message_summary header => $header, padding => $padding, }); - return STR2EUC( $header_info ."\n". $buf ); + return STR2EUC( $header_info ."\n". $msgbuf ); } } else { @@ -235,7 +237,7 @@ Ken'ichi Fukamachi =head1 COPYRIGHT -Copyright (C) 2001,2002 Ken'ichi Fukamachi +Copyright (C) 2001,2002,2003 Ken'ichi Fukamachi All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
