diff options
| author | fukachan <fukachan> | 2004-12-08 10:49:40 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2004-12-08 10:49:40 +0000 |
| commit | df6a9c31b554c74bae07f6a12f558fbe0c155cd3 (patch) | |
| tree | 807a2f5cb7311d0a03bf8310c3ee573e2abb4429 | |
| parent | 37cf54d015f0c17e7c05f6ec6ac9e6c494b09a09 (diff) | |
| download | fml8-df6a9c31b554c74bae07f6a12f558fbe0c155cd3.tar.gz fml8-df6a9c31b554c74bae07f6a12f558fbe0c155cd3.tar.bz2 fml8-df6a9c31b554c74bae07f6a12f558fbe0c155cd3.zip | |
test of message_chain_as_array_ref()
| -rwxr-xr-x | regress/message/show_mime_headers.pl | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/regress/message/show_mime_headers.pl b/regress/message/show_mime_headers.pl index 92d3f898..49bfdc6f 100755 --- a/regress/message/show_mime_headers.pl +++ b/regress/message/show_mime_headers.pl @@ -5,7 +5,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: basic_io.pl,v 1.5 2002/04/18 14:18:09 fukachan Exp $ +# $FML: show_mime_headers.pl,v 1.1 2004/12/08 07:27:33 fukachan Exp $ # use strict; @@ -18,13 +18,29 @@ my $test_mode = $ENV{'test_mode'} ? 1 : 0; my $tmp = "/tmp/buf$$"; for my $f (@ARGV) { - my $fh = new FileHandle $f; - my $wh = new FileHandle "> $tmp"; - my $obj = Mail::Message->parse( { fd => $fh } ); + my $fh = new FileHandle $f; + my $wh = new FileHandle "> $tmp"; + my $obj = Mail::Message->parse( { fd => $fh } ); + my $head = $obj->whole_message_header(); + my $i = 0; + + print "1. \n"; + $i = 0; + for (my $m = $obj->{ next }; $m->{ next }; $m = $m->{ next }) { + ++$i; + print "($i) {"; + print $m->{ header }; + print "}\n"; + } - for (my $m = $obj ; $m->{ next }; $m = $m->{ next }) { + print "2. \n"; + $i = 0; + my $list = $obj->message_chain_as_array_ref(); + for my $m (@$list) { + ++$i; + print "($i) {"; print $m->{ header }; - print "\n"; + print "}\n"; } } |
