Skip to content

Commit f7117db

Browse files
xsawyerxdanpovey
authored andcommitted
[scripts] Use correct compile-time regex syntax in split_scp.pl (#3287)
Regular expressions should be written with // to allow the language to do compile-time checks for the regexp pattern. This is from `perldoc perlop`: If the right argument is an expression rather than a search pattern, substitution, or transliteration, it is interpreted as a search pattern at run time. Note that this means that its contents will be interpolated twice, so '\\' =~ q'\\'; is not ok, as the regex engine will end up trying to compile the pattern "\", which it will consider a syntax error.
1 parent 230992f commit f7117db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

egs/wsj/s5/utils/split_scp.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
die "Invalid num-jobs and job-id: $num_jobs and $job_id";
5656
}
5757
}
58-
if ($ARGV[0] =~ "--utt2spk=(.+)") {
58+
if ($ARGV[0] =~ /--utt2spk=(.+)/) {
5959
$utt2spk_file=$1;
6060
shift;
6161
}

0 commit comments

Comments
 (0)