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:
authorHieu Hoang <hieuhoang@gmail.com>2015-08-26 10:21:40 +0300
committerHieu Hoang <hieuhoang@gmail.com>2015-08-26 10:21:40 +0300
commitfa34aa68e281f318376702f663fe6b9c5214800e (patch)
tree5eecca541b18ff205df9069d040e10c547c81caf
parentc2b66405c907b393dbf2c1ccb75fd2eeef91a467 (diff)
use env for all .pl files
-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
-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/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.pl2
-rwxr-xr-xtests/phrase.dyn-sa/filter-stdout.pl2
-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
172 files changed, 172 insertions, 172 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/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/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
index 2f6e176..4c279a1 100755
--- a/tests/phrase.dyn-sa/filter-stderr.pl
+++ b/tests/phrase.dyn-sa/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.dyn-sa/filter-stdout.pl b/tests/phrase.dyn-sa/filter-stdout.pl
index 476ddf6..0715c2d 100755
--- a/tests/phrase.dyn-sa/filter-stdout.pl
+++ b/tests/phrase.dyn-sa/filter-stdout.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
$x=0;
while (<>) {
chomp;
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;