0

I am a beginner in programming with perl and csh. I am facing some difficulty understanding code like:

/some_perl_algorithm.pl -n 166 \ 
    -p "/some_xml.list." \
    -s "" \
    /some_other.list

exit $status
  1. what do these -n -p -s switches mean?
  2. what do these backslashes at the end of the lines (\) mean?
  3. Is that /some_perl_algorithm.pl the same as perl some_perl_algorithm.pl?
  4. what does this code try to do?

Can anyone help? Or point me some good tutorials?

4

2 回答 2

0

Calling /some_perl_algorithm.pl is most likely the same as perl /some_perl_algorith.pl. This depends on the first line in that file. See "shebang", i.e. on http://en.wikipedia.org/wiki/Shebang_(Unix)

The other questions can't be answered without kowing what some_perl_algorithm.pl ìs. The arguments are passed to the Perl script.

于 2013-02-21T20:47:53.820 回答
0

perldoc 是你的朋友。perldoc perlintro 从

另外: http: //perldoc.perl.org/perlrun.html#Command-Switches

  • -p 表示在作为参数提供的所有行中循环脚本。
  • -n 类似,但在这种情况下被 -p 覆盖。
  • -s 将 166 作为参数放入文件中。
于 2013-02-22T07:26:32.937 回答