Mercurial > hg > Game > Cerium
view bin/get_xml_image.pl @ 2044:66aa91f6f4df draft
merge
author | Shin,ichi Uehara |
---|---|
date | Wed, 25 Mar 2015 19:13:56 +0900 |
parents | 3e1caef39798 |
children |
line wrap: on
line source
#!/usr/bin/perl use MIME::Base64; my $image; my $buf; while(<>) { if (/<image name="(.*)">/) { $image= $1; $buf = ''; } elsif (/<\/image>/ ) { open(OUT, ">/tmp/$image") ; print OUT decode_base64($buf); $image = ''; } elsif ($image) { $buf .= $_; } }