English 中文(简体)
在windows dos shell下执行带参数的Perl脚本的正确命令行是什么
原标题:What is the correct command line to execute Perl script with arguments under windows dos shell
  • 时间:2011-05-23 18:49:23
  •  标签:
  • perl

我试图在datasets.txt上运行一个Perl脚本“conlleval,pl”。我已经在windows7 64位下安装了Activeperl。此外,我还没有Perl的背景知识,这是第一次。

  • Question: what is the correct command line to execute the script with the data set from the command line? and how to save the result in a "output.txt"?

这是正确的方法吗?

c: >;Perl conllevall.pl<;dataset.txt<;output.txt

注意:脚本和数据集在同一个位置,我认为这是路径问题。-我尝试了很多教程,但没有成功。我找不到任何例子:(

最佳回答

如果您阅读STDIN(使用<;>;构造),最简单的是

perl conllevall.pl dataset.txt > output.txt

通过将.pl扩展与perl关联

conllevall.pl dataset.txt > output.txt

应该起作用。

问题回答

perl-conllevall.pl dataset.txt>;output.txt





相关问题
Why does my chdir to a filehandle not work in Perl?

When I try a "chdir" with a filehandle as argument, "chdir" returns 0 and a pwd returns still the same directory. Should that be so? I tried this, because in the documentation to chdir I found: "...

How do I use GetOptions to get the default argument?

I ve read the doc for GetOptions but I can t seem to find what I need... (maybe I am blind) What I want to do is to parse command line like this myperlscript.pl -mode [sth] [inputfile] I can use ...

Object-Oriented Perl constructor syntax and named parameters

I m a little confused about what is going on in Perl constructors. I found these two examples perldoc perlbot. package Foo; #In Perl, the constructor is just a subroutine called new. sub new { #I ...

Where can I find object-oriented Perl tutorials? [closed]

A Google search yields a number of results - but which ones are the best? The Perl site appears to contain two - perlboot and perltoot. I m reading these now, but what else is out there? Note: I ve ...

热门标签