Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTetsuo Kiso <tetsuo-s@is.naist.jp>2011-12-08 21:14:41 +0400
committerTetsuo Kiso <tetsuo-s@is.naist.jp>2011-12-08 21:14:41 +0400
commitef76d89f38de18cce58f1a189b99ebf1052faca1 (patch)
tree98a1fb5497ac206e8cb113cbb456379d57990851 /scripts
parent108cd429151f2ff7c6e0c094864bc325e9679144 (diff)
Minor change: make concatenatiton operations on filenames portable.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/training/mert-moses.pl19
1 files changed, 8 insertions, 11 deletions
diff --git a/scripts/training/mert-moses.pl b/scripts/training/mert-moses.pl
index 438c0e634..7744ed28f 100755
--- a/scripts/training/mert-moses.pl
+++ b/scripts/training/mert-moses.pl
@@ -1305,19 +1305,16 @@ sub submit_or_exec {
sub create_extractor_script()
{
my ($cmd, $outdir) = @_;
+ my $script_path = File::Spec->catfile($outdir, "extractor.sh");
- my $script_path = $outdir."/extractor.sh";
-
- open(OUT,"> $script_path")
- or die "Can't write $script_path";
- print OUT "#!/bin/bash\n";
- print OUT "cd $outdir\n";
- print OUT $cmd."\n";
- close(OUT);
+ open my $out, '>', $script_path
+ or die "Couldn't open $script_path for writing: $!\n";
+ print $out "#!/bin/bash\n";
+ print $out "cd $outdir\n";
+ print $out "$cmd\n";
+ close($out);
`chmod +x $script_path`;
- return $script_path;
+ return $script_path;
}
-
-