言語モデルを生成するためのperlスクリプト(http://www.speech.cs.cmu.edu/tools/download/quick_lm.pl)をダウンロードしました。perl <file.pl>は出力なしで実行されます
perl quick_lm.pl
を実行すると、単に終了します。全く出力がありません。
はい、私はperlをインストールしてあり、
perl -v
は完全に動作しています。私は単純なhello-world perlスクリプトを作成しました。これはうまく動作します。 [最後に添付]
したがって、
quick_lm.pl
の最初の行にprint "hello";
を含めて試したところ、perl quick_lm.pl
を試しても何も起こりません。
は私もchmod 777 quick_lm.pl
を使用してquick_lm.pl
すべての権限を与えてみました。私は./quick_lm.pl
を行うとき、今ではエラーを与える:
-bash: ./quick_lm.pl: /usr/local/bin/perl: bad interpreter: No such file or directory
私はこのエラーを検索し、ほぼすべてのソリューションは、Windows CLRFを指摘し、それらとは違って、私は/usr/local/bin/perl
で^M
を持っていません。また、まだperl quick_lm.pl
はうまくいくはずですか?
[bash.log]
[email protected]:~/dictionary$ perl quick_lm.pl
[email protected]:~/dictionary$ perl quick_lm.pl -s words.txt
[email protected]:~/dictionary$ nano quick_lm.pl
[email protected]:~/dictionary$ perl quick_lm.pl -s words.txt
[email protected]:~/dictionary$ chmod 777 quick_lm.pl
[email protected]:~/dictionary$ ./quick_lm.pl
-bash: ./quick_lm.pl: /usr/local/bin/perl: bad interpreter: No such file or directory
[email protected]:~/dictionary$ cat new.pl
#!/usr/bin/perl -w
use strict;
print "Hello World\n";
[email protected]:~/dictionary$ perl new.pl
Hello World
[email protected]:~/dictionary$
[quick_lm.pl
の初めにprint
を追加すると、問題の最小、runableデモにそれを軽減した後。]
#!/usr/local/bin/perl -w
=POD
...license...
=END
use Getopt::Std;
print "hello world";
$VERBOSE = 1;
sub handler { local($sig) = @_;
print STDERR "quick_lm caught a SIG$sig -- dying\n";
exit(0);
}
foreach (qw(XCPU KILL TERM STOP)) { $SIG{$_} = \&handler; }
この完全なスクリプトではない、完全なスクリプトは最初の行に記載されたリンクにあります。私はそれが私のperlの設定と同じくらいファイルに関連しているかどうかはわかりません。あなたが推測したように、私はperlについてあまり考えていません。
私はあなたの時間を感謝し、:)
あなたの 'perl'はどこにインストールされていますか? 'command -v perl'と入力すると何が得られますか?おそらく '/ usr/local/bin/perl'ではなく'/usr/bin/perl'でしょうか? –
@EricRenoufあなたはその部分について正しいです。実際には '/ usr/bin/perl'にインストールされています。ファイルを '#!/ usr/bin/perl -w'に編集しましたが、エラーは出ませんが、出力はありません。 –
上記のスクリプトをコピーして貼り付けると結果が再現できないので、新しい行がなくても "hello world"という警告が表示されるので、プロンプトの横に隠れている可能性があります。 –