annotate bin/get_xml_image.pl @ 1872:a1bfda09128a draft

add IO threads in CpuThreads
author masa
date Fri, 27 Dec 2013 20:58:30 +0900
parents 3e1caef39798
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1093
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #!/usr/bin/perl
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 use MIME::Base64;
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 my $image;
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 my $buf;
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 while(<>) {
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 if (/<image name="(.*)">/) {
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 $image= $1;
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 $buf = '';
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 } elsif (/<\/image>/ ) {
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 open(OUT, ">/tmp/$image") ;
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 print OUT decode_base64($buf);
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 $image = '';
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 } elsif ($image) {
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 $buf .= $_;
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 }
3e1caef39798 add get_xml_image.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 }