diff options
| author | fukachan <fukachan> | 2003-02-11 11:22:56 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-02-11 11:22:56 +0000 |
| commit | e1075958d5a4c801fea8c290708cae7bba2bef07 (patch) | |
| tree | 69466db0911a4c77c368d71f4387f798644c262b /fml/lib/Mail/ThreadTrack | |
| parent | b0b36e0d77666bc0178db3e96d769aaa27618d5a (diff) | |
| download | fml8-e1075958d5a4c801fea8c290708cae7bba2bef07.tar.gz fml8-e1075958d5a4c801fea8c290708cae7bba2bef07.tar.bz2 fml8-e1075958d5a4c801fea8c290708cae7bba2bef07.zip | |
FNF: not use $_
Diffstat (limited to 'fml/lib/Mail/ThreadTrack')
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/Print/HTML.pm | 44 | ||||
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/Print/Text.pm | 14 |
2 files changed, 34 insertions, 24 deletions
diff --git a/fml/lib/Mail/ThreadTrack/Print/HTML.pm b/fml/lib/Mail/ThreadTrack/Print/HTML.pm index 28b88507..6eaf4249 100644 --- a/fml/lib/Mail/ThreadTrack/Print/HTML.pm +++ b/fml/lib/Mail/ThreadTrack/Print/HTML.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: HTML.pm,v 1.15 2003/01/11 15:14:26 fukachan Exp $ +# $FML: HTML.pm,v 1.16 2003/01/11 15:16:37 fukachan Exp $ # package Mail::ThreadTrack::Print::HTML; @@ -63,27 +63,35 @@ sub show_articles_in_thread use FileHandle; my $s = ''; - for (split(/\s+/, $articles)) { + for my $article (split(/\s+/, $articles)) { my $file = $self->filepath({ base_dir => $spool_dir, - id => $_, + id => $article, }); - my $fh = new FileHandle $file; - while (defined($_ = $fh->getline())) { - # ignore header part. - next if 1 .. /^$/; - - # XXX-TODO: care for non Japanese char(s). - # XXX-TODO: to avoid CSS bug, convert all special char(s). - # XXX-TODO: create method safe_html_string() in Mail::Message ? - $s = STR2EUC($_); - $s =~ s/&/&/g; - $s =~ s/</</g; - $s =~ s/>/>/g; - $s =~ s/\"/"/g; - print $s; + + # XXX-TODO: care for non Japanese char(s). + # XXX-TODO: to avoid CSS bug, convert all special char(s). + # XXX-TODO: create method safe_html_string() in Mail::Message ? + if (-f $file) { + my $fh = new FileHandle $file; + + if (defined $fh) { + my $buf; + + while (defined($buf = $fh->getline())) { + # ignore header part. + next if 1 .. $buf =~ /^$/o; + + $s = STR2EUC($buf); + $s =~ s/&/&/g; + $s =~ s/</</g; + $s =~ s/>/>/g; + $s =~ s/\"/"/g; + print $s; + } + $fh->close; + } } - $fh->close; } } diff --git a/fml/lib/Mail/ThreadTrack/Print/Text.pm b/fml/lib/Mail/ThreadTrack/Print/Text.pm index 44549202..c6d5a6a1 100644 --- a/fml/lib/Mail/ThreadTrack/Print/Text.pm +++ b/fml/lib/Mail/ThreadTrack/Print/Text.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Text.pm,v 1.13 2003/01/11 15:14:26 fukachan Exp $ +# $FML: Text.pm,v 1.14 2003/01/11 15:16:37 fukachan Exp $ # package Mail::ThreadTrack::Print::Text; @@ -69,12 +69,14 @@ sub show_articles_in_thread my $fh = new FileHandle $file; if (defined $fh) { + my $buf; + LINE: - while (defined($_ = $fh->getline())) { - next LINE if 1 .. /^$/; + while (defined($buf = $fh->getline())) { + next LINE if 1 .. $buf =~ /^$/o; # XXX-TODO: we suppose Japanese only here. - $s = STR2EUC($_); + $s = STR2EUC($buf); print $wh $s; } $fh->close; @@ -142,8 +144,8 @@ sub _format_list my $r = ''; ID: - for (@idlist) { - $r .= $_ . " "; + for my $id (@idlist) { + $r .= $id . " "; if (length($r) > $max) { $r .= "..."; last ID; |
