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

github.com/moses-smt/moses-regression-tests.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdefer/chart.hierarchical.ondisk/filter-stderr.pl2
-rwxr-xr-xdefer/chart.hierarchical.ondisk/filter-stdout.pl2
-rwxr-xr-xdefer/chart.hierarchical/filter-stderr.pl2
-rwxr-xr-xdefer/chart.hierarchical/filter-stdout.pl2
-rwxr-xr-xdefer/chart.nbest-with-alignment/filter-nbest.pl2
-rwxr-xr-xdefer/chart.nbest-with-alignment/filter-stderr.pl2
-rwxr-xr-xdefer/chart.nbest-with-alignment/filter-stdout.pl2
-rwxr-xr-xdefer/phrase.continue-partial-translation.oldformat/filter-stderr.pl2
-rwxr-xr-xdefer/phrase.continue-partial-translation.oldformat/filter-stdout.pl2
-rwxr-xr-xdefer/phrase.continue-partial-translation/filter-stderr.pl2
-rwxr-xr-xdefer/phrase.continue-partial-translation/filter-stdout.pl2
-rwxr-xr-xdefer/phrase.early-distortion-cost/filter-nbest.pl2
-rwxr-xr-xdefer/phrase.early-distortion-cost/filter-stderr.pl2
-rwxr-xr-xdefer/phrase.early-distortion-cost/filter-stdout.pl2
-rwxr-xr-xdefer/phrase.multiple-translation-system-lr/filter-stderr.pl2
-rwxr-xr-xdefer/phrase.multiple-translation-system-lr/filter-stdout.pl2
-rwxr-xr-xdefer/phrase.multiple-translation-system/filter-stderr.pl2
-rwxr-xr-xdefer/phrase.multiple-translation-system/filter-stdout.pl2
-rwxr-xr-xdefer/phrase.phrase-length-feature.nbest/filter-nbest.pl2
-rwxr-xr-xdefer/phrase.phrase-length-feature.nbest/filter-stderr.pl2
-rwxr-xr-xdefer/phrase.phrase-length-feature.nbest/filter-stdout.pl2
-rwxr-xr-xdefer/phrase.word-translation.nbest/filter-nbest.pl2
-rwxr-xr-xdefer/phrase.word-translation.nbest/filter-stderr.pl2
-rwxr-xr-xdefer/phrase.word-translation.nbest/filter-stdout.pl2
-rw-r--r--lm/europarl.en.srilm.gzbin36294289 -> 36286731 bytes
-rwxr-xr-xtests/chart.hierarchical-withkenlm/filter-stderr.pl2
-rwxr-xr-xtests/chart.hierarchical-withkenlm/filter-stdout.pl2
-rwxr-xr-xtests/chart.hierarchical.incremental/filter-stderr.pl2
-rwxr-xr-xtests/chart.hierarchical.incremental/filter-stdout.pl2
-rwxr-xr-xtests/chart.hierarchical.ondisk.kenlm/filter-stderr.pl2
-rwxr-xr-xtests/chart.hierarchical.ondisk.kenlm/filter-stdout.pl2
-rwxr-xr-xtests/chart.nbest-with-alignment.kenlm/filter-nbest.pl2
-rwxr-xr-xtests/chart.nbest-with-alignment.kenlm/filter-stderr.pl2
-rwxr-xr-xtests/chart.nbest-with-alignment.kenlm/filter-stdout.pl2
-rwxr-xr-xtests/chart.show-weights.target-syntax/filter-stderr.pl2
-rwxr-xr-xtests/chart.show-weights.target-syntax/filter-stdout.pl2
-rwxr-xr-xtests/chart.suffix-array/filter-stderr.pl2
-rwxr-xr-xtests/chart.suffix-array/filter-stdout.pl2
-rwxr-xr-xtests/chart.target-syntax.ondisk/filter-stderr.pl2
-rwxr-xr-xtests/chart.target-syntax.ondisk/filter-stdout.pl2
-rwxr-xr-xtests/chart.target-syntax/filter-stderr.pl2
-rwxr-xr-xtests/chart.target-syntax/filter-stdout.pl2
-rwxr-xr-xtests/misc.binarize-compress-pt/run.perl3
-rwxr-xr-xtests/misc.consolidate/run.perl3
-rwxr-xr-xtests/misc.extract-parallel-weighted/run.perl3
-rwxr-xr-xtests/misc.extract-parallel/run.perl3
-rwxr-xr-xtests/misc.lexical-weights-weighted/run.perl3
-rwxr-xr-xtests/misc.lexical-weights/run.perl3
-rwxr-xr-xtests/misc.lexreorder-weighted/run.perl3
-rwxr-xr-xtests/misc.lexreorder/run.perl3
-rwxr-xr-xtests/misc.mml-basic/run.perl3
-rwxr-xr-xtests/misc.mml-domain/run.perl3
-rwxr-xr-xtests/misc.mml-ignore-lines/run.perl3
-rwxr-xr-xtests/phrase.TargetNGramFeature/filter-stderr.pl2
-rwxr-xr-xtests/phrase.TargetNGramFeature/filter-stdout.pl2
-rwxr-xr-xtests/phrase.basic-lm-oov.oldformat/filter-stderr.pl2
-rwxr-xr-xtests/phrase.basic-lm-oov.oldformat/filter-stdout.pl2
-rwxr-xr-xtests/phrase.basic-lm-oov/filter-stderr.pl2
-rwxr-xr-xtests/phrase.basic-lm-oov/filter-stdout.pl2
-rwxr-xr-xtests/phrase.basic-surface-binptable.oldformat/filter-stderr.pl2
-rwxr-xr-xtests/phrase.basic-surface-binptable.oldformat/filter-stdout.pl2
-rwxr-xr-xtests/phrase.basic-surface-binptable/filter-stderr.pl2
-rwxr-xr-xtests/phrase.basic-surface-binptable/filter-stdout.pl2
-rwxr-xr-xtests/phrase.basic-surface-ondisk/filter-stderr.pl2
-rwxr-xr-xtests/phrase.basic-surface-ondisk/filter-stdout.pl2
-rwxr-xr-xtests/phrase.basic-surface-only-withirstlm-binlm.oldformat/filter-stderr.pl2
-rwxr-xr-xtests/phrase.basic-surface-only-withirstlm-binlm.oldformat/filter-stdout.pl2
-rwxr-xr-xtests/phrase.basic-surface-only-withirstlm-binlm/filter-stderr.pl2
-rwxr-xr-xtests/phrase.basic-surface-only-withirstlm-binlm/filter-stdout.pl2
-rwxr-xr-xtests/phrase.basic-surface-only-withirstlm.oldformat/filter-stderr.pl2
-rwxr-xr-xtests/phrase.basic-surface-only-withirstlm.oldformat/filter-stdout.pl2
-rwxr-xr-xtests/phrase.basic-surface-only-withirstlm/filter-stderr.pl2
-rwxr-xr-xtests/phrase.basic-surface-only-withirstlm/filter-stdout.pl2
-rwxr-xr-xtests/phrase.basic-surface-only.oldformat/filter-stderr.pl2
-rwxr-xr-xtests/phrase.basic-surface-only.oldformat/filter-stdout.pl2
-rwxr-xr-xtests/phrase.basic-surface-only/filter-stderr.pl2
-rwxr-xr-xtests/phrase.basic-surface-only/filter-stdout.pl2
-rwxr-xr-xtests/phrase.compresspt.oldformat/filter-nbest.pl2
-rwxr-xr-xtests/phrase.compresspt.oldformat/filter-stderr.pl2
-rwxr-xr-xtests/phrase.compresspt.oldformat/filter-stdout.pl2
-rwxr-xr-xtests/phrase.compresspt/filter-nbest.pl2
-rwxr-xr-xtests/phrase.compresspt/filter-stderr.pl2
-rwxr-xr-xtests/phrase.compresspt/filter-stdout.pl2
-rwxr-xr-xtests/phrase.confusionNet-multi-factor/filter-stderr.pl2
-rwxr-xr-xtests/phrase.confusionNet-multi-factor/filter-stdout.pl2
-rwxr-xr-xtests/phrase.confusionNet-surface-only.binary/filter-nbest.pl2
-rwxr-xr-xtests/phrase.confusionNet-surface-only.binary/filter-stderr.pl2
-rwxr-xr-xtests/phrase.confusionNet-surface-only.binary/filter-stdout.pl2
-rwxr-xr-xtests/phrase.confusionNet-surface-only.mem/filter-nbest.pl2
-rwxr-xr-xtests/phrase.confusionNet-surface-only.mem/filter-stderr.pl2
-rwxr-xr-xtests/phrase.confusionNet-surface-only.mem/filter-stdout.pl2
-rwxr-xr-xtests/phrase.confusionNet-surface-only.ondisk/filter-nbest.pl2
-rwxr-xr-xtests/phrase.confusionNet-surface-only.ondisk/filter-stderr.pl2
-rwxr-xr-xtests/phrase.confusionNet-surface-only.ondisk/filter-stdout.pl2
-rwxr-xr-xtests/phrase.confusionNet-surface-only/filter-stderr.pl2
-rwxr-xr-xtests/phrase.confusionNet-surface-only/filter-stdout.pl2
-rwxr-xr-xtests/phrase.consensus-decoding-surface.oldformat/filter-stderr.pl2
-rwxr-xr-xtests/phrase.consensus-decoding-surface.oldformat/filter-stdout.pl2
-rwxr-xr-xtests/phrase.consensus-decoding-surface/filter-stderr.pl2
-rwxr-xr-xtests/phrase.consensus-decoding-surface/filter-stdout.pl2
-rwxr-xr-xtests/phrase.dyn-sa/filter-stderr.pl22
-rwxr-xr-xtests/phrase.dyn-sa/filter-stdout.pl7
-rwxr-xr-xtests/phrase.early-distortion-cost.kenlm/filter-nbest.pl2
-rwxr-xr-xtests/phrase.early-distortion-cost.kenlm/filter-stderr.pl2
-rwxr-xr-xtests/phrase.early-distortion-cost.kenlm/filter-stdout.pl2
-rwxr-xr-xtests/phrase.lattice-distortion/filter-nbest.pl2
-rwxr-xr-xtests/phrase.lattice-distortion/filter-stderr.pl2
-rwxr-xr-xtests/phrase.lattice-distortion/filter-stdout.pl2
-rwxr-xr-xtests/phrase.lattice-surface/filter-stderr.pl2
-rwxr-xr-xtests/phrase.lattice-surface/filter-stdout.pl2
-rwxr-xr-xtests/phrase.lattice.bin/filter-stderr.pl2
-rwxr-xr-xtests/phrase.lattice.bin/filter-stdout.pl2
-rwxr-xr-xtests/phrase.lattice.mem/filter-stderr.pl2
-rwxr-xr-xtests/phrase.lattice.mem/filter-stdout.pl2
-rwxr-xr-xtests/phrase.lattice.ondisk/filter-stderr.pl2
-rwxr-xr-xtests/phrase.lattice.ondisk/filter-stdout.pl2
-rwxr-xr-xtests/phrase.lexicalized-reordering-bin/filter-stderr.pl2
-rwxr-xr-xtests/phrase.lexicalized-reordering-bin/filter-stdout.pl2
-rwxr-xr-xtests/phrase.lexicalized-reordering-cn/filter-stderr.pl2
-rwxr-xr-xtests/phrase.lexicalized-reordering-cn/filter-stdout.pl2
-rwxr-xr-xtests/phrase.lexicalized-reordering-sparse/filter-stderr.pl2
-rwxr-xr-xtests/phrase.lexicalized-reordering-sparse/filter-stdout.pl2
-rwxr-xr-xtests/phrase.lexicalized-reordering/filter-stderr.pl2
-rwxr-xr-xtests/phrase.lexicalized-reordering/filter-stdout.pl2
-rwxr-xr-xtests/phrase.multi-factor-binptable/filter-stderr.pl2
-rwxr-xr-xtests/phrase.multi-factor-binptable/filter-stdout.pl2
-rwxr-xr-xtests/phrase.multi-factor-drop/dropize_phrase_table.pl2
-rwxr-xr-xtests/phrase.multi-factor-drop/filter-stderr.pl2
-rwxr-xr-xtests/phrase.multi-factor-drop/filter-stdout.pl2
-rwxr-xr-xtests/phrase.multi-factor.oldformat/filter-stderr.pl2
-rwxr-xr-xtests/phrase.multi-factor.oldformat/filter-stdout.pl2
-rwxr-xr-xtests/phrase.multi-factor/filter-stderr.pl2
-rwxr-xr-xtests/phrase.multi-factor/filter-stdout.pl2
-rwxr-xr-xtests/phrase.multi-lm/filter-stderr.pl2
-rwxr-xr-xtests/phrase.multi-lm/filter-stdout.pl2
-rwxr-xr-xtests/phrase.multimodel-binptable/filter-stderr.pl2
-rwxr-xr-xtests/phrase.multimodel-binptable/filter-stdout.pl2
-rwxr-xr-xtests/phrase.multimodel/filter-stderr.pl2
-rwxr-xr-xtests/phrase.multimodel/filter-stdout.pl2
-rwxr-xr-xtests/phrase.multimodelcounts/filter-stderr.pl2
-rwxr-xr-xtests/phrase.multimodelcounts/filter-stdout.pl2
-rwxr-xr-xtests/phrase.nbest-multi-factor.distinct/filter-nbest.pl2
-rwxr-xr-xtests/phrase.nbest-multi-factor.distinct/filter-stderr.pl2
-rwxr-xr-xtests/phrase.nbest-multi-factor.distinct/filter-stdout.pl2
-rwxr-xr-xtests/phrase.nbest-multi-factor/filter-nbest.pl2
-rwxr-xr-xtests/phrase.nbest-multi-factor/filter-stderr.pl2
-rwxr-xr-xtests/phrase.nbest-multi-factor/filter-stdout.pl2
-rwxr-xr-xtests/phrase.nbest-with-alignment/filter-nbest.pl2
-rwxr-xr-xtests/phrase.nbest-with-alignment/filter-stderr.pl2
-rwxr-xr-xtests/phrase.nbest-with-alignment/filter-stdout.pl2
-rwxr-xr-xtests/phrase.phrase-length-feature/filter-stderr.pl2
-rwxr-xr-xtests/phrase.phrase-length-feature/filter-stdout.pl2
-rwxr-xr-xtests/phrase.placeholder/filter-stderr.pl2
-rwxr-xr-xtests/phrase.placeholder/filter-stdout.pl2
-rwxr-xr-xtests/phrase.ptable-filtering/filter-stderr.pl2
-rwxr-xr-xtests/phrase.ptable-filtering/filter-stdout.pl2
-rwxr-xr-xtests/phrase.show-weights.lex-reorder.oldformat/filter-stderr.pl2
-rwxr-xr-xtests/phrase.show-weights.lex-reorder.oldformat/filter-stdout.pl2
-rwxr-xr-xtests/phrase.show-weights.lex-reorder/filter-stderr.pl2
-rwxr-xr-xtests/phrase.show-weights.lex-reorder/filter-stdout.pl2
-rwxr-xr-xtests/phrase.show-weights/filter-stderr.pl2
-rwxr-xr-xtests/phrase.show-weights/filter-stdout.pl2
-rwxr-xr-xtests/phrase.source-word-deletion.nbest/filter-nbest.pl2
-rwxr-xr-xtests/phrase.source-word-deletion.nbest/filter-stderr.pl2
-rwxr-xr-xtests/phrase.source-word-deletion.nbest/filter-stdout.pl2
-rwxr-xr-xtests/phrase.source-word-deletion/filter-stderr.pl2
-rwxr-xr-xtests/phrase.source-word-deletion/filter-stdout.pl2
-rwxr-xr-xtests/phrase.sparse-features/filter-nbest.pl2
-rwxr-xr-xtests/phrase.sparse-features/filter-stderr.pl2
-rwxr-xr-xtests/phrase.sparse-features/filter-stdout.pl2
-rwxr-xr-xtests/phrase.sparse-phrase-table.oldformat/filter-stderr.pl2
-rwxr-xr-xtests/phrase.sparse-phrase-table.oldformat/filter-stdout.pl2
-rwxr-xr-xtests/phrase.sparse-phrase-table/filter-stderr.pl2
-rwxr-xr-xtests/phrase.sparse-phrase-table/filter-stdout.pl2
-rwxr-xr-xtests/phrase.target-word-insertion/filter-stderr.pl2
-rwxr-xr-xtests/phrase.target-word-insertion/filter-stdout.pl2
-rwxr-xr-xtests/phrase.word-translation/filter-stderr.pl2
-rwxr-xr-xtests/phrase.word-translation/filter-stdout.pl2
-rwxr-xr-xtests/phrase.xml-markup.oldformat/filter-nbest.pl2
-rwxr-xr-xtests/phrase.xml-markup.oldformat/filter-stderr.pl2
-rwxr-xr-xtests/phrase.xml-markup.oldformat/filter-stdout.pl2
-rwxr-xr-xtests/phrase.xml-markup/filter-nbest.pl2
-rwxr-xr-xtests/phrase.xml-markup/filter-stderr.pl2
-rwxr-xr-xtests/phrase.xml-markup/filter-stdout.pl2
-rwxr-xr-xtests/score.phrase-based-inv/run-test-scorer.perl3
-rwxr-xr-xtests/score.phrase-based-with-alignment-inv/run-test-scorer.perl3
186 files changed, 225 insertions, 183 deletions
diff --git a/defer/chart.hierarchical.ondisk/filter-stderr.pl b/defer/chart.hierarchical.ondisk/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/defer/chart.hierarchical.ondisk/filter-stderr.pl
+++ b/defer/chart.hierarchical.ondisk/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/defer/chart.hierarchical.ondisk/filter-stdout.pl b/defer/chart.hierarchical.ondisk/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/defer/chart.hierarchical.ondisk/filter-stdout.pl
+++ b/defer/chart.hierarchical.ondisk/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/defer/chart.hierarchical/filter-stderr.pl b/defer/chart.hierarchical/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/defer/chart.hierarchical/filter-stderr.pl
+++ b/defer/chart.hierarchical/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/defer/chart.hierarchical/filter-stdout.pl b/defer/chart.hierarchical/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/defer/chart.hierarchical/filter-stdout.pl
+++ b/defer/chart.hierarchical/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/defer/chart.nbest-with-alignment/filter-nbest.pl b/defer/chart.nbest-with-alignment/filter-nbest.pl
index 4d34fe0..7003b7d 100755
--- a/defer/chart.nbest-with-alignment/filter-nbest.pl
+++ b/defer/chart.nbest-with-alignment/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
use strict;
diff --git a/defer/chart.nbest-with-alignment/filter-stderr.pl b/defer/chart.nbest-with-alignment/filter-stderr.pl
index a359091..bd2583b 100755
--- a/defer/chart.nbest-with-alignment/filter-stderr.pl
+++ b/defer/chart.nbest-with-alignment/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/defer/chart.nbest-with-alignment/filter-stdout.pl b/defer/chart.nbest-with-alignment/filter-stdout.pl
index 3f2ec42..7a272c1 100755
--- a/defer/chart.nbest-with-alignment/filter-stdout.pl
+++ b/defer/chart.nbest-with-alignment/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/defer/phrase.continue-partial-translation.oldformat/filter-stderr.pl b/defer/phrase.continue-partial-translation.oldformat/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/defer/phrase.continue-partial-translation.oldformat/filter-stderr.pl
+++ b/defer/phrase.continue-partial-translation.oldformat/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/defer/phrase.continue-partial-translation.oldformat/filter-stdout.pl b/defer/phrase.continue-partial-translation.oldformat/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/defer/phrase.continue-partial-translation.oldformat/filter-stdout.pl
+++ b/defer/phrase.continue-partial-translation.oldformat/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/defer/phrase.continue-partial-translation/filter-stderr.pl b/defer/phrase.continue-partial-translation/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/defer/phrase.continue-partial-translation/filter-stderr.pl
+++ b/defer/phrase.continue-partial-translation/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/defer/phrase.continue-partial-translation/filter-stdout.pl b/defer/phrase.continue-partial-translation/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/defer/phrase.continue-partial-translation/filter-stdout.pl
+++ b/defer/phrase.continue-partial-translation/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/defer/phrase.early-distortion-cost/filter-nbest.pl b/defer/phrase.early-distortion-cost/filter-nbest.pl
index 4d34fe0..7003b7d 100755
--- a/defer/phrase.early-distortion-cost/filter-nbest.pl
+++ b/defer/phrase.early-distortion-cost/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
use strict;
diff --git a/defer/phrase.early-distortion-cost/filter-stderr.pl b/defer/phrase.early-distortion-cost/filter-stderr.pl
index a359091..bd2583b 100755
--- a/defer/phrase.early-distortion-cost/filter-stderr.pl
+++ b/defer/phrase.early-distortion-cost/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/defer/phrase.early-distortion-cost/filter-stdout.pl b/defer/phrase.early-distortion-cost/filter-stdout.pl
index 3f2ec42..7a272c1 100755
--- a/defer/phrase.early-distortion-cost/filter-stdout.pl
+++ b/defer/phrase.early-distortion-cost/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/defer/phrase.multiple-translation-system-lr/filter-stderr.pl b/defer/phrase.multiple-translation-system-lr/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/defer/phrase.multiple-translation-system-lr/filter-stderr.pl
+++ b/defer/phrase.multiple-translation-system-lr/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/defer/phrase.multiple-translation-system-lr/filter-stdout.pl b/defer/phrase.multiple-translation-system-lr/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/defer/phrase.multiple-translation-system-lr/filter-stdout.pl
+++ b/defer/phrase.multiple-translation-system-lr/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/defer/phrase.multiple-translation-system/filter-stderr.pl b/defer/phrase.multiple-translation-system/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/defer/phrase.multiple-translation-system/filter-stderr.pl
+++ b/defer/phrase.multiple-translation-system/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/defer/phrase.multiple-translation-system/filter-stdout.pl b/defer/phrase.multiple-translation-system/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/defer/phrase.multiple-translation-system/filter-stdout.pl
+++ b/defer/phrase.multiple-translation-system/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/defer/phrase.phrase-length-feature.nbest/filter-nbest.pl b/defer/phrase.phrase-length-feature.nbest/filter-nbest.pl
index 705fcee..0b147e5 100755
--- a/defer/phrase.phrase-length-feature.nbest/filter-nbest.pl
+++ b/defer/phrase.phrase-length-feature.nbest/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
$oldcode = "";
while (<>) {
diff --git a/defer/phrase.phrase-length-feature.nbest/filter-stderr.pl b/defer/phrase.phrase-length-feature.nbest/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/defer/phrase.phrase-length-feature.nbest/filter-stderr.pl
+++ b/defer/phrase.phrase-length-feature.nbest/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/defer/phrase.phrase-length-feature.nbest/filter-stdout.pl b/defer/phrase.phrase-length-feature.nbest/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/defer/phrase.phrase-length-feature.nbest/filter-stdout.pl
+++ b/defer/phrase.phrase-length-feature.nbest/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/defer/phrase.word-translation.nbest/filter-nbest.pl b/defer/phrase.word-translation.nbest/filter-nbest.pl
index 705fcee..0b147e5 100755
--- a/defer/phrase.word-translation.nbest/filter-nbest.pl
+++ b/defer/phrase.word-translation.nbest/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
$oldcode = "";
while (<>) {
diff --git a/defer/phrase.word-translation.nbest/filter-stderr.pl b/defer/phrase.word-translation.nbest/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/defer/phrase.word-translation.nbest/filter-stderr.pl
+++ b/defer/phrase.word-translation.nbest/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/defer/phrase.word-translation.nbest/filter-stdout.pl b/defer/phrase.word-translation.nbest/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/defer/phrase.word-translation.nbest/filter-stdout.pl
+++ b/defer/phrase.word-translation.nbest/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/lm/europarl.en.srilm.gz b/lm/europarl.en.srilm.gz
index 4657884..7009b07 100644
--- a/lm/europarl.en.srilm.gz
+++ b/lm/europarl.en.srilm.gz
Binary files differ
diff --git a/tests/chart.hierarchical-withkenlm/filter-stderr.pl b/tests/chart.hierarchical-withkenlm/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/chart.hierarchical-withkenlm/filter-stderr.pl
+++ b/tests/chart.hierarchical-withkenlm/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/chart.hierarchical-withkenlm/filter-stdout.pl b/tests/chart.hierarchical-withkenlm/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/chart.hierarchical-withkenlm/filter-stdout.pl
+++ b/tests/chart.hierarchical-withkenlm/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/chart.hierarchical.incremental/filter-stderr.pl b/tests/chart.hierarchical.incremental/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/chart.hierarchical.incremental/filter-stderr.pl
+++ b/tests/chart.hierarchical.incremental/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/chart.hierarchical.incremental/filter-stdout.pl b/tests/chart.hierarchical.incremental/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/chart.hierarchical.incremental/filter-stdout.pl
+++ b/tests/chart.hierarchical.incremental/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/chart.hierarchical.ondisk.kenlm/filter-stderr.pl b/tests/chart.hierarchical.ondisk.kenlm/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/chart.hierarchical.ondisk.kenlm/filter-stderr.pl
+++ b/tests/chart.hierarchical.ondisk.kenlm/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/chart.hierarchical.ondisk.kenlm/filter-stdout.pl b/tests/chart.hierarchical.ondisk.kenlm/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/chart.hierarchical.ondisk.kenlm/filter-stdout.pl
+++ b/tests/chart.hierarchical.ondisk.kenlm/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/chart.nbest-with-alignment.kenlm/filter-nbest.pl b/tests/chart.nbest-with-alignment.kenlm/filter-nbest.pl
index 4d34fe0..7003b7d 100755
--- a/tests/chart.nbest-with-alignment.kenlm/filter-nbest.pl
+++ b/tests/chart.nbest-with-alignment.kenlm/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
use strict;
diff --git a/tests/chart.nbest-with-alignment.kenlm/filter-stderr.pl b/tests/chart.nbest-with-alignment.kenlm/filter-stderr.pl
index a359091..bd2583b 100755
--- a/tests/chart.nbest-with-alignment.kenlm/filter-stderr.pl
+++ b/tests/chart.nbest-with-alignment.kenlm/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/chart.nbest-with-alignment.kenlm/filter-stdout.pl b/tests/chart.nbest-with-alignment.kenlm/filter-stdout.pl
index 3f2ec42..7a272c1 100755
--- a/tests/chart.nbest-with-alignment.kenlm/filter-stdout.pl
+++ b/tests/chart.nbest-with-alignment.kenlm/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/chart.show-weights.target-syntax/filter-stderr.pl b/tests/chart.show-weights.target-syntax/filter-stderr.pl
index 9580c19..c09cb1e 100755
--- a/tests/chart.show-weights.target-syntax/filter-stderr.pl
+++ b/tests/chart.show-weights.target-syntax/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/chart.show-weights.target-syntax/filter-stdout.pl b/tests/chart.show-weights.target-syntax/filter-stdout.pl
index bf00754..9e3c043 100755
--- a/tests/chart.show-weights.target-syntax/filter-stdout.pl
+++ b/tests/chart.show-weights.target-syntax/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/chart.suffix-array/filter-stderr.pl b/tests/chart.suffix-array/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/chart.suffix-array/filter-stderr.pl
+++ b/tests/chart.suffix-array/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/chart.suffix-array/filter-stdout.pl b/tests/chart.suffix-array/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/chart.suffix-array/filter-stdout.pl
+++ b/tests/chart.suffix-array/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/chart.target-syntax.ondisk/filter-stderr.pl b/tests/chart.target-syntax.ondisk/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/chart.target-syntax.ondisk/filter-stderr.pl
+++ b/tests/chart.target-syntax.ondisk/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/chart.target-syntax.ondisk/filter-stdout.pl b/tests/chart.target-syntax.ondisk/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/chart.target-syntax.ondisk/filter-stdout.pl
+++ b/tests/chart.target-syntax.ondisk/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/chart.target-syntax/filter-stderr.pl b/tests/chart.target-syntax/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/chart.target-syntax/filter-stderr.pl
+++ b/tests/chart.target-syntax/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/chart.target-syntax/filter-stdout.pl b/tests/chart.target-syntax/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/chart.target-syntax/filter-stdout.pl
+++ b/tests/chart.target-syntax/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/misc.binarize-compress-pt/run.perl b/tests/misc.binarize-compress-pt/run.perl
index 8e07e99..05e52e8 100755
--- a/tests/misc.binarize-compress-pt/run.perl
+++ b/tests/misc.binarize-compress-pt/run.perl
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use warnings;
use strict;
my $script_dir; BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, $script_dir; }
use MosesRegressionTesting;
diff --git a/tests/misc.consolidate/run.perl b/tests/misc.consolidate/run.perl
index ad18980..e0e523d 100755
--- a/tests/misc.consolidate/run.perl
+++ b/tests/misc.consolidate/run.perl
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use warnings;
use strict;
my $script_dir; BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, $script_dir; }
use MosesRegressionTesting;
diff --git a/tests/misc.extract-parallel-weighted/run.perl b/tests/misc.extract-parallel-weighted/run.perl
index 566a02f..91f6fe2 100755
--- a/tests/misc.extract-parallel-weighted/run.perl
+++ b/tests/misc.extract-parallel-weighted/run.perl
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use warnings;
use strict;
my $script_dir; BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, $script_dir; }
use MosesRegressionTesting;
diff --git a/tests/misc.extract-parallel/run.perl b/tests/misc.extract-parallel/run.perl
index 427a55c..334de06 100755
--- a/tests/misc.extract-parallel/run.perl
+++ b/tests/misc.extract-parallel/run.perl
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use warnings;
use strict;
my $script_dir; BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, $script_dir; }
use MosesRegressionTesting;
diff --git a/tests/misc.lexical-weights-weighted/run.perl b/tests/misc.lexical-weights-weighted/run.perl
index 2ff07ff..33e1e77 100755
--- a/tests/misc.lexical-weights-weighted/run.perl
+++ b/tests/misc.lexical-weights-weighted/run.perl
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use warnings;
use strict;
my $script_dir; BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, $script_dir; }
use MosesRegressionTesting;
diff --git a/tests/misc.lexical-weights/run.perl b/tests/misc.lexical-weights/run.perl
index 507bcdd..233916d 100755
--- a/tests/misc.lexical-weights/run.perl
+++ b/tests/misc.lexical-weights/run.perl
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use warnings;
use strict;
my $script_dir; BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, $script_dir; }
use MosesRegressionTesting;
diff --git a/tests/misc.lexreorder-weighted/run.perl b/tests/misc.lexreorder-weighted/run.perl
index a7f25df..25ecb3f 100755
--- a/tests/misc.lexreorder-weighted/run.perl
+++ b/tests/misc.lexreorder-weighted/run.perl
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use warnings;
use strict;
my $script_dir; BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, $script_dir; }
use MosesRegressionTesting;
diff --git a/tests/misc.lexreorder/run.perl b/tests/misc.lexreorder/run.perl
index a7f25df..25ecb3f 100755
--- a/tests/misc.lexreorder/run.perl
+++ b/tests/misc.lexreorder/run.perl
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use warnings;
use strict;
my $script_dir; BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, $script_dir; }
use MosesRegressionTesting;
diff --git a/tests/misc.mml-basic/run.perl b/tests/misc.mml-basic/run.perl
index 53c7ef6..2205b4f 100755
--- a/tests/misc.mml-basic/run.perl
+++ b/tests/misc.mml-basic/run.perl
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use warnings;
use strict;
my $script_dir; BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, $script_dir; }
use MosesRegressionTesting;
diff --git a/tests/misc.mml-domain/run.perl b/tests/misc.mml-domain/run.perl
index 6d66142..cdbd8e9 100755
--- a/tests/misc.mml-domain/run.perl
+++ b/tests/misc.mml-domain/run.perl
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use warnings;
use strict;
my $script_dir; BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, $script_dir; }
use MosesRegressionTesting;
diff --git a/tests/misc.mml-ignore-lines/run.perl b/tests/misc.mml-ignore-lines/run.perl
index 53c7ef6..2205b4f 100755
--- a/tests/misc.mml-ignore-lines/run.perl
+++ b/tests/misc.mml-ignore-lines/run.perl
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use warnings;
use strict;
my $script_dir; BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, $script_dir; }
use MosesRegressionTesting;
diff --git a/tests/phrase.TargetNGramFeature/filter-stderr.pl b/tests/phrase.TargetNGramFeature/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.TargetNGramFeature/filter-stderr.pl
+++ b/tests/phrase.TargetNGramFeature/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.TargetNGramFeature/filter-stdout.pl b/tests/phrase.TargetNGramFeature/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.TargetNGramFeature/filter-stdout.pl
+++ b/tests/phrase.TargetNGramFeature/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.basic-lm-oov.oldformat/filter-stderr.pl b/tests/phrase.basic-lm-oov.oldformat/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.basic-lm-oov.oldformat/filter-stderr.pl
+++ b/tests/phrase.basic-lm-oov.oldformat/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.basic-lm-oov.oldformat/filter-stdout.pl b/tests/phrase.basic-lm-oov.oldformat/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.basic-lm-oov.oldformat/filter-stdout.pl
+++ b/tests/phrase.basic-lm-oov.oldformat/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.basic-lm-oov/filter-stderr.pl b/tests/phrase.basic-lm-oov/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.basic-lm-oov/filter-stderr.pl
+++ b/tests/phrase.basic-lm-oov/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.basic-lm-oov/filter-stdout.pl b/tests/phrase.basic-lm-oov/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.basic-lm-oov/filter-stdout.pl
+++ b/tests/phrase.basic-lm-oov/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.basic-surface-binptable.oldformat/filter-stderr.pl b/tests/phrase.basic-surface-binptable.oldformat/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.basic-surface-binptable.oldformat/filter-stderr.pl
+++ b/tests/phrase.basic-surface-binptable.oldformat/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.basic-surface-binptable.oldformat/filter-stdout.pl b/tests/phrase.basic-surface-binptable.oldformat/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.basic-surface-binptable.oldformat/filter-stdout.pl
+++ b/tests/phrase.basic-surface-binptable.oldformat/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.basic-surface-binptable/filter-stderr.pl b/tests/phrase.basic-surface-binptable/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.basic-surface-binptable/filter-stderr.pl
+++ b/tests/phrase.basic-surface-binptable/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.basic-surface-binptable/filter-stdout.pl b/tests/phrase.basic-surface-binptable/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.basic-surface-binptable/filter-stdout.pl
+++ b/tests/phrase.basic-surface-binptable/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.basic-surface-ondisk/filter-stderr.pl b/tests/phrase.basic-surface-ondisk/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.basic-surface-ondisk/filter-stderr.pl
+++ b/tests/phrase.basic-surface-ondisk/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.basic-surface-ondisk/filter-stdout.pl b/tests/phrase.basic-surface-ondisk/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.basic-surface-ondisk/filter-stdout.pl
+++ b/tests/phrase.basic-surface-ondisk/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.basic-surface-only-withirstlm-binlm.oldformat/filter-stderr.pl b/tests/phrase.basic-surface-only-withirstlm-binlm.oldformat/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.basic-surface-only-withirstlm-binlm.oldformat/filter-stderr.pl
+++ b/tests/phrase.basic-surface-only-withirstlm-binlm.oldformat/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.basic-surface-only-withirstlm-binlm.oldformat/filter-stdout.pl b/tests/phrase.basic-surface-only-withirstlm-binlm.oldformat/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.basic-surface-only-withirstlm-binlm.oldformat/filter-stdout.pl
+++ b/tests/phrase.basic-surface-only-withirstlm-binlm.oldformat/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.basic-surface-only-withirstlm-binlm/filter-stderr.pl b/tests/phrase.basic-surface-only-withirstlm-binlm/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.basic-surface-only-withirstlm-binlm/filter-stderr.pl
+++ b/tests/phrase.basic-surface-only-withirstlm-binlm/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.basic-surface-only-withirstlm-binlm/filter-stdout.pl b/tests/phrase.basic-surface-only-withirstlm-binlm/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.basic-surface-only-withirstlm-binlm/filter-stdout.pl
+++ b/tests/phrase.basic-surface-only-withirstlm-binlm/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.basic-surface-only-withirstlm.oldformat/filter-stderr.pl b/tests/phrase.basic-surface-only-withirstlm.oldformat/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.basic-surface-only-withirstlm.oldformat/filter-stderr.pl
+++ b/tests/phrase.basic-surface-only-withirstlm.oldformat/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.basic-surface-only-withirstlm.oldformat/filter-stdout.pl b/tests/phrase.basic-surface-only-withirstlm.oldformat/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.basic-surface-only-withirstlm.oldformat/filter-stdout.pl
+++ b/tests/phrase.basic-surface-only-withirstlm.oldformat/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.basic-surface-only-withirstlm/filter-stderr.pl b/tests/phrase.basic-surface-only-withirstlm/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.basic-surface-only-withirstlm/filter-stderr.pl
+++ b/tests/phrase.basic-surface-only-withirstlm/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.basic-surface-only-withirstlm/filter-stdout.pl b/tests/phrase.basic-surface-only-withirstlm/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.basic-surface-only-withirstlm/filter-stdout.pl
+++ b/tests/phrase.basic-surface-only-withirstlm/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.basic-surface-only.oldformat/filter-stderr.pl b/tests/phrase.basic-surface-only.oldformat/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.basic-surface-only.oldformat/filter-stderr.pl
+++ b/tests/phrase.basic-surface-only.oldformat/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.basic-surface-only.oldformat/filter-stdout.pl b/tests/phrase.basic-surface-only.oldformat/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.basic-surface-only.oldformat/filter-stdout.pl
+++ b/tests/phrase.basic-surface-only.oldformat/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.basic-surface-only/filter-stderr.pl b/tests/phrase.basic-surface-only/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.basic-surface-only/filter-stderr.pl
+++ b/tests/phrase.basic-surface-only/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.basic-surface-only/filter-stdout.pl b/tests/phrase.basic-surface-only/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.basic-surface-only/filter-stdout.pl
+++ b/tests/phrase.basic-surface-only/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.compresspt.oldformat/filter-nbest.pl b/tests/phrase.compresspt.oldformat/filter-nbest.pl
index 4d34fe0..7003b7d 100755
--- a/tests/phrase.compresspt.oldformat/filter-nbest.pl
+++ b/tests/phrase.compresspt.oldformat/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
use strict;
diff --git a/tests/phrase.compresspt.oldformat/filter-stderr.pl b/tests/phrase.compresspt.oldformat/filter-stderr.pl
index a359091..bd2583b 100755
--- a/tests/phrase.compresspt.oldformat/filter-stderr.pl
+++ b/tests/phrase.compresspt.oldformat/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.compresspt.oldformat/filter-stdout.pl b/tests/phrase.compresspt.oldformat/filter-stdout.pl
index 3f2ec42..7a272c1 100755
--- a/tests/phrase.compresspt.oldformat/filter-stdout.pl
+++ b/tests/phrase.compresspt.oldformat/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.compresspt/filter-nbest.pl b/tests/phrase.compresspt/filter-nbest.pl
index 4d34fe0..7003b7d 100755
--- a/tests/phrase.compresspt/filter-nbest.pl
+++ b/tests/phrase.compresspt/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
use strict;
diff --git a/tests/phrase.compresspt/filter-stderr.pl b/tests/phrase.compresspt/filter-stderr.pl
index a359091..bd2583b 100755
--- a/tests/phrase.compresspt/filter-stderr.pl
+++ b/tests/phrase.compresspt/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.compresspt/filter-stdout.pl b/tests/phrase.compresspt/filter-stdout.pl
index 3f2ec42..7a272c1 100755
--- a/tests/phrase.compresspt/filter-stdout.pl
+++ b/tests/phrase.compresspt/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.confusionNet-multi-factor/filter-stderr.pl b/tests/phrase.confusionNet-multi-factor/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.confusionNet-multi-factor/filter-stderr.pl
+++ b/tests/phrase.confusionNet-multi-factor/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.confusionNet-multi-factor/filter-stdout.pl b/tests/phrase.confusionNet-multi-factor/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.confusionNet-multi-factor/filter-stdout.pl
+++ b/tests/phrase.confusionNet-multi-factor/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.confusionNet-surface-only.binary/filter-nbest.pl b/tests/phrase.confusionNet-surface-only.binary/filter-nbest.pl
index 705fcee..0b147e5 100755
--- a/tests/phrase.confusionNet-surface-only.binary/filter-nbest.pl
+++ b/tests/phrase.confusionNet-surface-only.binary/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
$oldcode = "";
while (<>) {
diff --git a/tests/phrase.confusionNet-surface-only.binary/filter-stderr.pl b/tests/phrase.confusionNet-surface-only.binary/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.confusionNet-surface-only.binary/filter-stderr.pl
+++ b/tests/phrase.confusionNet-surface-only.binary/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.confusionNet-surface-only.binary/filter-stdout.pl b/tests/phrase.confusionNet-surface-only.binary/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.confusionNet-surface-only.binary/filter-stdout.pl
+++ b/tests/phrase.confusionNet-surface-only.binary/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.confusionNet-surface-only.mem/filter-nbest.pl b/tests/phrase.confusionNet-surface-only.mem/filter-nbest.pl
index 705fcee..0b147e5 100755
--- a/tests/phrase.confusionNet-surface-only.mem/filter-nbest.pl
+++ b/tests/phrase.confusionNet-surface-only.mem/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
$oldcode = "";
while (<>) {
diff --git a/tests/phrase.confusionNet-surface-only.mem/filter-stderr.pl b/tests/phrase.confusionNet-surface-only.mem/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.confusionNet-surface-only.mem/filter-stderr.pl
+++ b/tests/phrase.confusionNet-surface-only.mem/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.confusionNet-surface-only.mem/filter-stdout.pl b/tests/phrase.confusionNet-surface-only.mem/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.confusionNet-surface-only.mem/filter-stdout.pl
+++ b/tests/phrase.confusionNet-surface-only.mem/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.confusionNet-surface-only.ondisk/filter-nbest.pl b/tests/phrase.confusionNet-surface-only.ondisk/filter-nbest.pl
index 705fcee..0b147e5 100755
--- a/tests/phrase.confusionNet-surface-only.ondisk/filter-nbest.pl
+++ b/tests/phrase.confusionNet-surface-only.ondisk/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
$oldcode = "";
while (<>) {
diff --git a/tests/phrase.confusionNet-surface-only.ondisk/filter-stderr.pl b/tests/phrase.confusionNet-surface-only.ondisk/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.confusionNet-surface-only.ondisk/filter-stderr.pl
+++ b/tests/phrase.confusionNet-surface-only.ondisk/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.confusionNet-surface-only.ondisk/filter-stdout.pl b/tests/phrase.confusionNet-surface-only.ondisk/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.confusionNet-surface-only.ondisk/filter-stdout.pl
+++ b/tests/phrase.confusionNet-surface-only.ondisk/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.confusionNet-surface-only/filter-stderr.pl b/tests/phrase.confusionNet-surface-only/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.confusionNet-surface-only/filter-stderr.pl
+++ b/tests/phrase.confusionNet-surface-only/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.confusionNet-surface-only/filter-stdout.pl b/tests/phrase.confusionNet-surface-only/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.confusionNet-surface-only/filter-stdout.pl
+++ b/tests/phrase.confusionNet-surface-only/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.consensus-decoding-surface.oldformat/filter-stderr.pl b/tests/phrase.consensus-decoding-surface.oldformat/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.consensus-decoding-surface.oldformat/filter-stderr.pl
+++ b/tests/phrase.consensus-decoding-surface.oldformat/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.consensus-decoding-surface.oldformat/filter-stdout.pl b/tests/phrase.consensus-decoding-surface.oldformat/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.consensus-decoding-surface.oldformat/filter-stdout.pl
+++ b/tests/phrase.consensus-decoding-surface.oldformat/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.consensus-decoding-surface/filter-stderr.pl b/tests/phrase.consensus-decoding-surface/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.consensus-decoding-surface/filter-stderr.pl
+++ b/tests/phrase.consensus-decoding-surface/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.consensus-decoding-surface/filter-stdout.pl b/tests/phrase.consensus-decoding-surface/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.consensus-decoding-surface/filter-stdout.pl
+++ b/tests/phrase.consensus-decoding-surface/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.dyn-sa/filter-stderr.pl b/tests/phrase.dyn-sa/filter-stderr.pl
new file mode 100755
index 0000000..4c279a1
--- /dev/null
+++ b/tests/phrase.dyn-sa/filter-stderr.pl
@@ -0,0 +1,22 @@
+#!/usr/bin/env perl
+
+BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
+use RegTestUtils;
+
+$x=0;
+while (<>) {
+ chomp;
+
+ if (/^Finished loading LanguageModels/) {
+ my $time = RegTestUtils::readTime($_);
+ print "LMLOAD_TIME ~ $time\n";
+ }
+ if (/^Finished loading phrase tables/) {
+ my $time = RegTestUtils::readTime($_);
+ print "PTLOAD_TIME ~ $time\n";
+ }
+ next unless /^BEST TRANSLATION:/;
+ my $pscore = RegTestUtils::readHypoScore($_);
+ $x++;
+ print "SCORE_$x = $pscore\n";
+}
diff --git a/tests/phrase.dyn-sa/filter-stdout.pl b/tests/phrase.dyn-sa/filter-stdout.pl
new file mode 100755
index 0000000..0715c2d
--- /dev/null
+++ b/tests/phrase.dyn-sa/filter-stdout.pl
@@ -0,0 +1,7 @@
+#!/usr/bin/env perl
+$x=0;
+while (<>) {
+ chomp;
+ $x++;
+ print "TRANSLATION_$x=$_\n";
+}
diff --git a/tests/phrase.early-distortion-cost.kenlm/filter-nbest.pl b/tests/phrase.early-distortion-cost.kenlm/filter-nbest.pl
index 4d34fe0..7003b7d 100755
--- a/tests/phrase.early-distortion-cost.kenlm/filter-nbest.pl
+++ b/tests/phrase.early-distortion-cost.kenlm/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
use strict;
diff --git a/tests/phrase.early-distortion-cost.kenlm/filter-stderr.pl b/tests/phrase.early-distortion-cost.kenlm/filter-stderr.pl
index a359091..bd2583b 100755
--- a/tests/phrase.early-distortion-cost.kenlm/filter-stderr.pl
+++ b/tests/phrase.early-distortion-cost.kenlm/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.early-distortion-cost.kenlm/filter-stdout.pl b/tests/phrase.early-distortion-cost.kenlm/filter-stdout.pl
index 3f2ec42..7a272c1 100755
--- a/tests/phrase.early-distortion-cost.kenlm/filter-stdout.pl
+++ b/tests/phrase.early-distortion-cost.kenlm/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.lattice-distortion/filter-nbest.pl b/tests/phrase.lattice-distortion/filter-nbest.pl
index 705fcee..0b147e5 100755
--- a/tests/phrase.lattice-distortion/filter-nbest.pl
+++ b/tests/phrase.lattice-distortion/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
$oldcode = "";
while (<>) {
diff --git a/tests/phrase.lattice-distortion/filter-stderr.pl b/tests/phrase.lattice-distortion/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.lattice-distortion/filter-stderr.pl
+++ b/tests/phrase.lattice-distortion/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.lattice-distortion/filter-stdout.pl b/tests/phrase.lattice-distortion/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.lattice-distortion/filter-stdout.pl
+++ b/tests/phrase.lattice-distortion/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.lattice-surface/filter-stderr.pl b/tests/phrase.lattice-surface/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.lattice-surface/filter-stderr.pl
+++ b/tests/phrase.lattice-surface/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.lattice-surface/filter-stdout.pl b/tests/phrase.lattice-surface/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.lattice-surface/filter-stdout.pl
+++ b/tests/phrase.lattice-surface/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.lattice.bin/filter-stderr.pl b/tests/phrase.lattice.bin/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.lattice.bin/filter-stderr.pl
+++ b/tests/phrase.lattice.bin/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.lattice.bin/filter-stdout.pl b/tests/phrase.lattice.bin/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.lattice.bin/filter-stdout.pl
+++ b/tests/phrase.lattice.bin/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.lattice.mem/filter-stderr.pl b/tests/phrase.lattice.mem/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.lattice.mem/filter-stderr.pl
+++ b/tests/phrase.lattice.mem/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.lattice.mem/filter-stdout.pl b/tests/phrase.lattice.mem/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.lattice.mem/filter-stdout.pl
+++ b/tests/phrase.lattice.mem/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.lattice.ondisk/filter-stderr.pl b/tests/phrase.lattice.ondisk/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.lattice.ondisk/filter-stderr.pl
+++ b/tests/phrase.lattice.ondisk/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.lattice.ondisk/filter-stdout.pl b/tests/phrase.lattice.ondisk/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.lattice.ondisk/filter-stdout.pl
+++ b/tests/phrase.lattice.ondisk/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.lexicalized-reordering-bin/filter-stderr.pl b/tests/phrase.lexicalized-reordering-bin/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.lexicalized-reordering-bin/filter-stderr.pl
+++ b/tests/phrase.lexicalized-reordering-bin/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.lexicalized-reordering-bin/filter-stdout.pl b/tests/phrase.lexicalized-reordering-bin/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.lexicalized-reordering-bin/filter-stdout.pl
+++ b/tests/phrase.lexicalized-reordering-bin/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.lexicalized-reordering-cn/filter-stderr.pl b/tests/phrase.lexicalized-reordering-cn/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.lexicalized-reordering-cn/filter-stderr.pl
+++ b/tests/phrase.lexicalized-reordering-cn/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.lexicalized-reordering-cn/filter-stdout.pl b/tests/phrase.lexicalized-reordering-cn/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.lexicalized-reordering-cn/filter-stdout.pl
+++ b/tests/phrase.lexicalized-reordering-cn/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.lexicalized-reordering-sparse/filter-stderr.pl b/tests/phrase.lexicalized-reordering-sparse/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.lexicalized-reordering-sparse/filter-stderr.pl
+++ b/tests/phrase.lexicalized-reordering-sparse/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.lexicalized-reordering-sparse/filter-stdout.pl b/tests/phrase.lexicalized-reordering-sparse/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.lexicalized-reordering-sparse/filter-stdout.pl
+++ b/tests/phrase.lexicalized-reordering-sparse/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.lexicalized-reordering/filter-stderr.pl b/tests/phrase.lexicalized-reordering/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.lexicalized-reordering/filter-stderr.pl
+++ b/tests/phrase.lexicalized-reordering/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.lexicalized-reordering/filter-stdout.pl b/tests/phrase.lexicalized-reordering/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.lexicalized-reordering/filter-stdout.pl
+++ b/tests/phrase.lexicalized-reordering/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.multi-factor-binptable/filter-stderr.pl b/tests/phrase.multi-factor-binptable/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.multi-factor-binptable/filter-stderr.pl
+++ b/tests/phrase.multi-factor-binptable/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.multi-factor-binptable/filter-stdout.pl b/tests/phrase.multi-factor-binptable/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.multi-factor-binptable/filter-stdout.pl
+++ b/tests/phrase.multi-factor-binptable/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.multi-factor-drop/dropize_phrase_table.pl b/tests/phrase.multi-factor-drop/dropize_phrase_table.pl
index e764eec..96a0e70 100755
--- a/tests/phrase.multi-factor-drop/dropize_phrase_table.pl
+++ b/tests/phrase.multi-factor-drop/dropize_phrase_table.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
#add_empties_to_phrase_table: go through an old-style pharaoh phrase table (no empty target sources) and add one such line for each single-word source phrase in the table,
#complete with factors (note the number and type of factors are hardcoded here);
diff --git a/tests/phrase.multi-factor-drop/filter-stderr.pl b/tests/phrase.multi-factor-drop/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.multi-factor-drop/filter-stderr.pl
+++ b/tests/phrase.multi-factor-drop/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.multi-factor-drop/filter-stdout.pl b/tests/phrase.multi-factor-drop/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.multi-factor-drop/filter-stdout.pl
+++ b/tests/phrase.multi-factor-drop/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.multi-factor.oldformat/filter-stderr.pl b/tests/phrase.multi-factor.oldformat/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.multi-factor.oldformat/filter-stderr.pl
+++ b/tests/phrase.multi-factor.oldformat/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.multi-factor.oldformat/filter-stdout.pl b/tests/phrase.multi-factor.oldformat/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.multi-factor.oldformat/filter-stdout.pl
+++ b/tests/phrase.multi-factor.oldformat/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.multi-factor/filter-stderr.pl b/tests/phrase.multi-factor/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.multi-factor/filter-stderr.pl
+++ b/tests/phrase.multi-factor/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.multi-factor/filter-stdout.pl b/tests/phrase.multi-factor/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.multi-factor/filter-stdout.pl
+++ b/tests/phrase.multi-factor/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.multi-lm/filter-stderr.pl b/tests/phrase.multi-lm/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.multi-lm/filter-stderr.pl
+++ b/tests/phrase.multi-lm/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.multi-lm/filter-stdout.pl b/tests/phrase.multi-lm/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.multi-lm/filter-stdout.pl
+++ b/tests/phrase.multi-lm/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.multimodel-binptable/filter-stderr.pl b/tests/phrase.multimodel-binptable/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.multimodel-binptable/filter-stderr.pl
+++ b/tests/phrase.multimodel-binptable/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.multimodel-binptable/filter-stdout.pl b/tests/phrase.multimodel-binptable/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.multimodel-binptable/filter-stdout.pl
+++ b/tests/phrase.multimodel-binptable/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.multimodel/filter-stderr.pl b/tests/phrase.multimodel/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.multimodel/filter-stderr.pl
+++ b/tests/phrase.multimodel/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.multimodel/filter-stdout.pl b/tests/phrase.multimodel/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.multimodel/filter-stdout.pl
+++ b/tests/phrase.multimodel/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.multimodelcounts/filter-stderr.pl b/tests/phrase.multimodelcounts/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.multimodelcounts/filter-stderr.pl
+++ b/tests/phrase.multimodelcounts/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.multimodelcounts/filter-stdout.pl b/tests/phrase.multimodelcounts/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.multimodelcounts/filter-stdout.pl
+++ b/tests/phrase.multimodelcounts/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.nbest-multi-factor.distinct/filter-nbest.pl b/tests/phrase.nbest-multi-factor.distinct/filter-nbest.pl
index 705fcee..0b147e5 100755
--- a/tests/phrase.nbest-multi-factor.distinct/filter-nbest.pl
+++ b/tests/phrase.nbest-multi-factor.distinct/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
$oldcode = "";
while (<>) {
diff --git a/tests/phrase.nbest-multi-factor.distinct/filter-stderr.pl b/tests/phrase.nbest-multi-factor.distinct/filter-stderr.pl
index a359091..bd2583b 100755
--- a/tests/phrase.nbest-multi-factor.distinct/filter-stderr.pl
+++ b/tests/phrase.nbest-multi-factor.distinct/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.nbest-multi-factor.distinct/filter-stdout.pl b/tests/phrase.nbest-multi-factor.distinct/filter-stdout.pl
index 3f2ec42..7a272c1 100755
--- a/tests/phrase.nbest-multi-factor.distinct/filter-stdout.pl
+++ b/tests/phrase.nbest-multi-factor.distinct/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.nbest-multi-factor/filter-nbest.pl b/tests/phrase.nbest-multi-factor/filter-nbest.pl
index 705fcee..0b147e5 100755
--- a/tests/phrase.nbest-multi-factor/filter-nbest.pl
+++ b/tests/phrase.nbest-multi-factor/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
$oldcode = "";
while (<>) {
diff --git a/tests/phrase.nbest-multi-factor/filter-stderr.pl b/tests/phrase.nbest-multi-factor/filter-stderr.pl
index a359091..bd2583b 100755
--- a/tests/phrase.nbest-multi-factor/filter-stderr.pl
+++ b/tests/phrase.nbest-multi-factor/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.nbest-multi-factor/filter-stdout.pl b/tests/phrase.nbest-multi-factor/filter-stdout.pl
index 3f2ec42..7a272c1 100755
--- a/tests/phrase.nbest-multi-factor/filter-stdout.pl
+++ b/tests/phrase.nbest-multi-factor/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.nbest-with-alignment/filter-nbest.pl b/tests/phrase.nbest-with-alignment/filter-nbest.pl
index 4d34fe0..7003b7d 100755
--- a/tests/phrase.nbest-with-alignment/filter-nbest.pl
+++ b/tests/phrase.nbest-with-alignment/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
use strict;
diff --git a/tests/phrase.nbest-with-alignment/filter-stderr.pl b/tests/phrase.nbest-with-alignment/filter-stderr.pl
index a359091..bd2583b 100755
--- a/tests/phrase.nbest-with-alignment/filter-stderr.pl
+++ b/tests/phrase.nbest-with-alignment/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.nbest-with-alignment/filter-stdout.pl b/tests/phrase.nbest-with-alignment/filter-stdout.pl
index 3f2ec42..7a272c1 100755
--- a/tests/phrase.nbest-with-alignment/filter-stdout.pl
+++ b/tests/phrase.nbest-with-alignment/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.phrase-length-feature/filter-stderr.pl b/tests/phrase.phrase-length-feature/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.phrase-length-feature/filter-stderr.pl
+++ b/tests/phrase.phrase-length-feature/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.phrase-length-feature/filter-stdout.pl b/tests/phrase.phrase-length-feature/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.phrase-length-feature/filter-stdout.pl
+++ b/tests/phrase.phrase-length-feature/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.placeholder/filter-stderr.pl b/tests/phrase.placeholder/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.placeholder/filter-stderr.pl
+++ b/tests/phrase.placeholder/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.placeholder/filter-stdout.pl b/tests/phrase.placeholder/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.placeholder/filter-stdout.pl
+++ b/tests/phrase.placeholder/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.ptable-filtering/filter-stderr.pl b/tests/phrase.ptable-filtering/filter-stderr.pl
index c48a43f..23cd714 100755
--- a/tests/phrase.ptable-filtering/filter-stderr.pl
+++ b/tests/phrase.ptable-filtering/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.ptable-filtering/filter-stdout.pl b/tests/phrase.ptable-filtering/filter-stdout.pl
index a0421ef..c5a3e5c 100755
--- a/tests/phrase.ptable-filtering/filter-stdout.pl
+++ b/tests/phrase.ptable-filtering/filter-stdout.pl
@@ -1,2 +1,2 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
diff --git a/tests/phrase.show-weights.lex-reorder.oldformat/filter-stderr.pl b/tests/phrase.show-weights.lex-reorder.oldformat/filter-stderr.pl
index 9580c19..c09cb1e 100755
--- a/tests/phrase.show-weights.lex-reorder.oldformat/filter-stderr.pl
+++ b/tests/phrase.show-weights.lex-reorder.oldformat/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.show-weights.lex-reorder.oldformat/filter-stdout.pl b/tests/phrase.show-weights.lex-reorder.oldformat/filter-stdout.pl
index bf00754..9e3c043 100755
--- a/tests/phrase.show-weights.lex-reorder.oldformat/filter-stdout.pl
+++ b/tests/phrase.show-weights.lex-reorder.oldformat/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.show-weights.lex-reorder/filter-stderr.pl b/tests/phrase.show-weights.lex-reorder/filter-stderr.pl
index 9580c19..c09cb1e 100755
--- a/tests/phrase.show-weights.lex-reorder/filter-stderr.pl
+++ b/tests/phrase.show-weights.lex-reorder/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.show-weights.lex-reorder/filter-stdout.pl b/tests/phrase.show-weights.lex-reorder/filter-stdout.pl
index bf00754..9e3c043 100755
--- a/tests/phrase.show-weights.lex-reorder/filter-stdout.pl
+++ b/tests/phrase.show-weights.lex-reorder/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.show-weights/filter-stderr.pl b/tests/phrase.show-weights/filter-stderr.pl
index 9580c19..c09cb1e 100755
--- a/tests/phrase.show-weights/filter-stderr.pl
+++ b/tests/phrase.show-weights/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.show-weights/filter-stdout.pl b/tests/phrase.show-weights/filter-stdout.pl
index bf00754..9e3c043 100755
--- a/tests/phrase.show-weights/filter-stdout.pl
+++ b/tests/phrase.show-weights/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.source-word-deletion.nbest/filter-nbest.pl b/tests/phrase.source-word-deletion.nbest/filter-nbest.pl
index 705fcee..0b147e5 100755
--- a/tests/phrase.source-word-deletion.nbest/filter-nbest.pl
+++ b/tests/phrase.source-word-deletion.nbest/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
$oldcode = "";
while (<>) {
diff --git a/tests/phrase.source-word-deletion.nbest/filter-stderr.pl b/tests/phrase.source-word-deletion.nbest/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.source-word-deletion.nbest/filter-stderr.pl
+++ b/tests/phrase.source-word-deletion.nbest/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.source-word-deletion.nbest/filter-stdout.pl b/tests/phrase.source-word-deletion.nbest/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.source-word-deletion.nbest/filter-stdout.pl
+++ b/tests/phrase.source-word-deletion.nbest/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.source-word-deletion/filter-stderr.pl b/tests/phrase.source-word-deletion/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.source-word-deletion/filter-stderr.pl
+++ b/tests/phrase.source-word-deletion/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.source-word-deletion/filter-stdout.pl b/tests/phrase.source-word-deletion/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.source-word-deletion/filter-stdout.pl
+++ b/tests/phrase.source-word-deletion/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.sparse-features/filter-nbest.pl b/tests/phrase.sparse-features/filter-nbest.pl
index 6deb93b..e63c083 100755
--- a/tests/phrase.sparse-features/filter-nbest.pl
+++ b/tests/phrase.sparse-features/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
use strict;
diff --git a/tests/phrase.sparse-features/filter-stderr.pl b/tests/phrase.sparse-features/filter-stderr.pl
index a359091..bd2583b 100755
--- a/tests/phrase.sparse-features/filter-stderr.pl
+++ b/tests/phrase.sparse-features/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.sparse-features/filter-stdout.pl b/tests/phrase.sparse-features/filter-stdout.pl
index 3f2ec42..7a272c1 100755
--- a/tests/phrase.sparse-features/filter-stdout.pl
+++ b/tests/phrase.sparse-features/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.sparse-phrase-table.oldformat/filter-stderr.pl b/tests/phrase.sparse-phrase-table.oldformat/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.sparse-phrase-table.oldformat/filter-stderr.pl
+++ b/tests/phrase.sparse-phrase-table.oldformat/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.sparse-phrase-table.oldformat/filter-stdout.pl b/tests/phrase.sparse-phrase-table.oldformat/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.sparse-phrase-table.oldformat/filter-stdout.pl
+++ b/tests/phrase.sparse-phrase-table.oldformat/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.sparse-phrase-table/filter-stderr.pl b/tests/phrase.sparse-phrase-table/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.sparse-phrase-table/filter-stderr.pl
+++ b/tests/phrase.sparse-phrase-table/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.sparse-phrase-table/filter-stdout.pl b/tests/phrase.sparse-phrase-table/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.sparse-phrase-table/filter-stdout.pl
+++ b/tests/phrase.sparse-phrase-table/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.target-word-insertion/filter-stderr.pl b/tests/phrase.target-word-insertion/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.target-word-insertion/filter-stderr.pl
+++ b/tests/phrase.target-word-insertion/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.target-word-insertion/filter-stdout.pl b/tests/phrase.target-word-insertion/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.target-word-insertion/filter-stdout.pl
+++ b/tests/phrase.target-word-insertion/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.word-translation/filter-stderr.pl b/tests/phrase.word-translation/filter-stderr.pl
index 2f6e176..4c279a1 100755
--- a/tests/phrase.word-translation/filter-stderr.pl
+++ b/tests/phrase.word-translation/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.word-translation/filter-stdout.pl b/tests/phrase.word-translation/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.word-translation/filter-stdout.pl
+++ b/tests/phrase.word-translation/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.xml-markup.oldformat/filter-nbest.pl b/tests/phrase.xml-markup.oldformat/filter-nbest.pl
index 705fcee..0b147e5 100755
--- a/tests/phrase.xml-markup.oldformat/filter-nbest.pl
+++ b/tests/phrase.xml-markup.oldformat/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
$oldcode = "";
while (<>) {
diff --git a/tests/phrase.xml-markup.oldformat/filter-stderr.pl b/tests/phrase.xml-markup.oldformat/filter-stderr.pl
index a359091..bd2583b 100755
--- a/tests/phrase.xml-markup.oldformat/filter-stderr.pl
+++ b/tests/phrase.xml-markup.oldformat/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.xml-markup.oldformat/filter-stdout.pl b/tests/phrase.xml-markup.oldformat/filter-stdout.pl
index 3f2ec42..7a272c1 100755
--- a/tests/phrase.xml-markup.oldformat/filter-stdout.pl
+++ b/tests/phrase.xml-markup.oldformat/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/phrase.xml-markup/filter-nbest.pl b/tests/phrase.xml-markup/filter-nbest.pl
index 705fcee..0b147e5 100755
--- a/tests/phrase.xml-markup/filter-nbest.pl
+++ b/tests/phrase.xml-markup/filter-nbest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
$oldcode = "";
while (<>) {
diff --git a/tests/phrase.xml-markup/filter-stderr.pl b/tests/phrase.xml-markup/filter-stderr.pl
index a359091..bd2583b 100755
--- a/tests/phrase.xml-markup/filter-stderr.pl
+++ b/tests/phrase.xml-markup/filter-stderr.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, "$script_dir/../perllib"; }
use RegTestUtils;
diff --git a/tests/phrase.xml-markup/filter-stdout.pl b/tests/phrase.xml-markup/filter-stdout.pl
index 3f2ec42..7a272c1 100755
--- a/tests/phrase.xml-markup/filter-stdout.pl
+++ b/tests/phrase.xml-markup/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
diff --git a/tests/score.phrase-based-inv/run-test-scorer.perl b/tests/score.phrase-based-inv/run-test-scorer.perl
index bdf1fa6..f9f7f5f 100755
--- a/tests/score.phrase-based-inv/run-test-scorer.perl
+++ b/tests/score.phrase-based-inv/run-test-scorer.perl
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use warnings;
use strict;
use FindBin qw($Bin);
use MosesRegressionTesting;
diff --git a/tests/score.phrase-based-with-alignment-inv/run-test-scorer.perl b/tests/score.phrase-based-with-alignment-inv/run-test-scorer.perl
index bdf1fa6..f9f7f5f 100755
--- a/tests/score.phrase-based-with-alignment-inv/run-test-scorer.perl
+++ b/tests/score.phrase-based-with-alignment-inv/run-test-scorer.perl
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+use warnings;
use strict;
use FindBin qw($Bin);
use MosesRegressionTesting;