📄 ch15_02.htm
字号:
> or not at all</P></TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para"><CODECLASS="literal">option!</CODE></P></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para">No</P></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para">May be given as - -<CODECLASS="literal">option</CODE> or - -<CODECLASS="literal">nooption</CODE></P></TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para"><CODECLASS="literal">option=s</CODE></P></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para">Yes</P></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para">Mandatory string parameter: - -<CODECLASS="literal">option</CODE>=<CODECLASS="literal">somestring</CODE></P></TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para"><CODECLASS="literal">option:s</CODE></P></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para">Yes</P></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para">Optional string parameter: - -<CODECLASS="literal">option</CODE> or - -<CODECLASS="literal">option</CODE>=<CODECLASS="literal">somestring</CODE></P></TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para"><CODECLASS="literal">option=i</CODE></P></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para">Yes</P></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para">Mandatory integer parameter: - -<CODECLASS="literal">option</CODE>=<CODECLASS="literal">35</CODE></P></TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para"><CODECLASS="literal">option:i</CODE></P></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para">Yes</P></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para">Optional integer parameter: - -<CODECLASS="literal">option</CODE> or - -<CODECLASS="literal">option</CODE>=<CODECLASS="literal">35</CODE></P></TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para"><CODECLASS="literal">option=f</CODE></P></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para">Yes</P></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para">Mandatory floating point parameter: - -<CODECLASS="literal">option</CODE>=<CODECLASS="literal">3.141</CODE></P></TD></TR><TRCLASS="row"VALIGN="TOP"><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para"><CODECLASS="literal">option:f</CODE></P></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para">Yes</P></TD><TDCLASS="entry"ROWSPAN="1"COLSPAN="1"><PCLASS="para">Optional floating point parameter: - -<CODECLASS="literal">option</CODE> or - -<CODECLASS="literal">option</CODE><ACLASS="indexterm"NAME="ch15-idx-1000005060-0"></A>=<CODECLASS="literal">3.141</CODE><ACLASS="indexterm"NAME="ch15-idx-1000005025-0"></A><ACLASS="indexterm"NAME="ch15-idx-1000005025-1"></A><ACLASS="indexterm"NAME="ch15-idx-1000005025-2"></A><ACLASS="indexterm"NAME="ch15-idx-1000005025-3"></A><ACLASS="indexterm"NAME="ch15-idx-1000005025-4"></A><ACLASS="indexterm"NAME="ch15-idx-1000005025-5"></A></P></TD></TR></TBODY></TABLE></DIV><DIVCLASS="sect2"><H3CLASS="sect2"><ACLASS="title"NAME="ch15-pgfId-229">See Also</A></H3><PCLASS="para">The documentation for the standard Getopt::Long and Getopt::Std modules; examples of argument parsing by hand can be found in <ACLASS="xref"HREF="ch01_06.htm"TITLE="Processing a String One Character at a Time">Recipe 1.5</A>, <ACLASS="xref"HREF="ch01_18.htm"TITLE="Program: fixstyle">Recipe 1.17</A>, <ACLASS="xref"HREF="ch06_23.htm"TITLE="Program: tcgrep">Recipe 6.22</A>, <ACLASS="xref"HREF="ch07_08.htm"TITLE="Writing a Filter">Recipe 7.7</A>, <ACLASS="xref"HREF="ch08_20.htm"TITLE="Program: tctee">Recipe 8.19</A>, and <ACLASS="xref"HREF="ch15_13.htm"TITLE="Managing the Screen">Recipe 15.12</A></P></DIV></DIV><DIVCLASS="htmlnav"><P></P><HRALIGN="LEFT"WIDTH="684"TITLE="footer"><TABLEWIDTH="684"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="228"><ACLASS="sect1"HREF="ch15_01.htm"TITLE="15.0. Introduction"><IMGSRC="../gifs/txtpreva.gif"ALT="Previous: 15.0. Introduction"BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="228"><ACLASS="book"HREF="index.htm"TITLE="Perl Cookbook"><IMGSRC="../gifs/txthome.gif"ALT="Perl Cookbook"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="228"><ACLASS="sect1"HREF="ch15_03.htm"TITLE="15.2. Testing Whether a Program Is Running Interactively"><IMGSRC="../gifs/txtnexta.gif"ALT="Next: 15.2. Testing Whether a Program Is Running Interactively"BORDER="0"></A></TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="228">15.0. Introduction</TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="228"><ACLASS="index"HREF="index/index.htm"TITLE="Book Index"><IMGSRC="../gifs/index.gif"ALT="Book Index"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="228">15.2. Testing Whether a Program Is Running Interactively</TD></TR></TABLE><HRALIGN="LEFT"WIDTH="684"TITLE="footer"><FONTSIZE="-1"></DIV<!-- LIBRARY NAV BAR --> <img src="../gifs/smnavbar.gif" usemap="#library-map" border="0" alt="Library Navigation Links"><p> <a href="copyrght.htm">Copyright © 2002</a> O'Reilly & Associates. All rights reserved.</font> </p> <map name="library-map"> <area shape="rect" coords="1,0,85,94" href="../index.htm"><area shape="rect" coords="86,1,178,103" href="../lwp/index.htm"><area shape="rect" coords="180,0,265,103" href="../lperl/index.htm"><area shape="rect" coords="267,0,353,105" href="../perlnut/index.htm"><area shape="rect" coords="354,1,446,115" href="../prog/index.htm"><area shape="rect" coords="448,0,526,132" href="../tk/index.htm"><area shape="rect" coords="528,1,615,119" href="../cookbook/index.htm"><area shape="rect" coords="617,0,690,135" href="../pxml/index.htm"></map> </BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -