#!/usr/local/bin/perl use strict; my @map = ( [513564, '+135,30,0.0', '+135,33,45.0', '+135,37,30.0', '+34,30,0.0', '+34,32,30.0', '+34,35,0.0'], #古市 [513573, '+135,22,30.0', '+135,26,15.0', '+135,30,0.0', '+34,35,0.0', '+34,37,30.0', '+34,40,0.0'], #大阪西南部 [513574, '+135,30,0.0', '+135,33,45.0', '+135,37,30.0', '+34,35,0.0', '+34,37,30.0', '+34,40,0.0'], #大阪東南部 [523503, '+135,22,30.0', '+135,26,15.0', '+135,30,0.0', '+34,40,0.0', '+34,42,30.0', '+34,45,0.0'], #大阪西北部 [523504, '+135,30,0.0', '+135,33,45.0', '+135,37,30.0', '+34,40,0.0', '+34,42,30.0', '+34,45,0.0'], #大阪東北部 [523505, '+135,37,30.0', '+135,41,15.0', '+135,45,0.0', '+34,40,0.0', '+34,42,30.0', '+34,45,0.0'], #生駒山 ); my $template = < tokyo TOP2 LEFT1 tokyo TOP1 LEFT2 tokyo TOP2 LEFT2 tokyo TOP1 LEFT3 tokyo TOP3 LEFT1 tokyo TOP2 LEFT2 tokyo TOP3 LEFT2 tokyo TOP2 LEFT3 END print < END foreach (@map) { my ($mapname, $x1, $x2, $x3, $y1, $y2, $y3) = @$_; my $text = $template; $text =~ s/MAPNAME/$mapname/gx; $text =~ s/LEFT1/$x1/gx; $text =~ s/LEFT2/$x2/gx; $text =~ s/LEFT3/$x3/gx; $text =~ s/TOP1/$y1/gx; $text =~ s/TOP2/$y2/gx; $text =~ s/TOP3/$y3/gx; print $text; } print < END __END__