diff --git a/dawg/xloc.pl b/dawg/xloc.pl index e13b41eff..381f1d21b 100755 --- a/dawg/xloc.pl +++ b/dawg/xloc.pl @@ -21,10 +21,8 @@ use strict; use xloc; -# For f*cking windoze linefeeds -binmode(STDOUT); - my $arg = shift(@ARGV); +my $outfile = shift(@ARGV); my $lang = shift(@ARGV); my $path = "./$lang"; my $infoFile = "$path/info.txt"; @@ -34,10 +32,16 @@ die "info file $infoFile not found\n" if ! -s $infoFile; my $xlocToken = xloc::ParseTileInfo($infoFile); +open OUTFILE, "> $outfile"; +# For f*cking windoze linefeeds +binmode( OUTFILE ); + if ( $arg eq "-t" ) { - xloc::WriteMapFile( $xlocToken, 0, \*STDOUT ); + xloc::WriteMapFile( $xlocToken, 0, \*OUTFILE ); } elsif ( $arg eq "-tn" ) { - xloc::WriteMapFile( $xlocToken, 1, \*STDOUT ); + xloc::WriteMapFile( $xlocToken, 1, \*OUTFILE ); } elsif ( $arg eq "-v" ) { - xloc::WriteValuesFile( $xlocToken, \*STDOUT ); + xloc::WriteValuesFile( $xlocToken, \*OUTFILE ); } + +close OUTFILE;