Edit D:\app\Administrator\product\11.2.0\dbhome_1\perl\html\lib\Getopt\Std.html
<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>getopts - Process single-character switches with switch clustering</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rev="made" href="mailto:" /> </head> <body style="background-color: white"> <table border="0" width="100%" cellspacing="0" cellpadding="3"> <tr><td class="block" style="background-color: #cccccc" valign="middle"> <big><strong><span class="block"> getopts - Process single-character switches with switch clustering</span></strong></big> </td></tr> </table> <!-- INDEX BEGIN --> <div name="index"> <p><a name="__index__"></a></p> <ul> <li><a href="#name">NAME</a></li> <li><a href="#synopsis">SYNOPSIS</a></li> <li><a href="#description">DESCRIPTION</a></li> <li><a href="#__help_and___version"><code>-help</code> and <code>-version</code></a></li> </ul> <hr name="index" /> </div> <!-- INDEX END --> <p> </p> <h1><a name="name">NAME</a></h1> <p>getopt, getopts - Process single-character switches with switch clustering</p> <p> </p> <hr /> <h1><a name="synopsis">SYNOPSIS</a></h1> <pre> use Getopt::Std;</pre> <pre> getopt('oDI'); # -o, -D & -I take arg. Sets $opt_* as a side effect. getopt('oDI', \%opts); # -o, -D & -I take arg. Values in %opts getopts('oif:'); # -o & -i are boolean flags, -f takes an argument # Sets $opt_* as a side effect. getopts('oif:', \%opts); # options as above. Values in %opts</pre> <p> </p> <hr /> <h1><a name="description">DESCRIPTION</a></h1> <p>The <code>getopt()</code> function processes single-character switches with switch clustering. Pass one argument which is a string containing all switches that take an argument. For each switch found, sets $opt_x (where x is the switch name) to the value of the argument if an argument is expected, or 1 otherwise. Switches which take an argument don't care whether there is a space between the switch and the argument.</p> <p>The <code>getopts()</code> function is similar, but you should pass to it the list of all switches to be recognized. If unspecified switches are found on the command-line, the user will be warned that an unknown option was given. The <code>getopts()</code> function returns true unless an invalid option was found.</p> <p>Note that, if your code is running under the recommended <code>use strict 'vars'</code> pragma, you will need to declare these package variables with "our":</p> <pre> our($opt_x, $opt_y);</pre> <p>For those of you who don't like additional global variables being created, <code>getopt()</code> and <code>getopts()</code> will also accept a hash reference as an optional second argument. Hash keys will be x (where x is the switch name) with key values the value of the argument or 1 if no argument is specified.</p> <p>To allow programs to process arguments that look like switches, but aren't, both functions will stop processing switches when they see the argument <code>--</code>. The <code>--</code> will be removed from @ARGV.</p> <p> </p> <hr /> <h1><a name="__help_and___version"><code>--help</code> and <code>--version</code></a></h1> <p>If <code>-</code> is not a recognized switch letter, <code>getopts()</code> supports arguments <code>--help</code> and <code>--version</code>. If <code>main::HELP_MESSAGE()</code> and/or <code>main::VERSION_MESSAGE()</code> are defined, they are called; the arguments are the output file handle, the name of option-processing package, its version, and the switches string. If the subroutines are not defined, an attempt is made to generate intelligent messages; for best results, define $main::VERSION.</p> <p>If embedded documentation (in pod format, see <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlpod.html">the perlpod manpage</a>) is detected in the script, <code>--help</code> will also show how to access the documentation.</p> <p>Note that due to excessive paranoia, if $Getopt::Std::STANDARD_HELP_VERSION isn't true (the default is false), then the messages are printed on STDERR, and the processing continues after the messages are printed. This being the opposite of the standard-conforming behaviour, it is strongly recommended to set $Getopt::Std::STANDARD_HELP_VERSION to true.</p> <p>One can change the output file handle of the messages by setting $Getopt::Std::OUTPUT_HELP_VERSION. One can print the messages of <code>--help</code> (without the <code>Usage:</code> line) and <code>--version</code> by calling functions <code>help_mess()</code> and <code>version_mess()</code> with the switches string as an argument.</p> <table border="0" width="100%" cellspacing="0" cellpadding="3"> <tr><td class="block" style="background-color: #cccccc" valign="middle"> <big><strong><span class="block"> getopts - Process single-character switches with switch clustering</span></strong></big> </td></tr> </table> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de