home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / perl5 / Getopt::Std.z / Getopt::Std
Encoding:
Text File  |  1998-10-30  |  1.8 KB  |  67 lines

  1.  
  2.  
  3.  
  4. GGGGeeeettttoooopppptttt::::::::SSSSttttdddd((((3333))))                                                  GGGGeeeettttoooopppptttt::::::::SSSSttttdddd((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      getopt - Process single-character switches with switch clustering
  10.  
  11.      getopts - Process single-character switches with switch clustering
  12.  
  13. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.          use Getopt::Std;
  15.  
  16.          getopt('oDI');    # -o, -D & -I take arg.  Sets opt_* as a side effect.
  17.          getopt('oDI', \%opts);    # -o, -D & -I take arg.  Values in %opts
  18.          getopts('oif:');  # -o & -i are boolean flags, -f takes an argument
  19.                            # Sets opt_* as a side effect.
  20.          getopts('oif:', \%opts);  # options as above. Values in %opts
  21.  
  22.  
  23. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  24.      The _g_e_t_o_p_t() functions processes single-character switches with switch
  25.      clustering.  Pass one argument which is a string containing all switches
  26.      that take an argument.  For each switch found, sets $opt_x (where x is
  27.      the switch name) to the value of the argument, or 1 if no argument.
  28.      Switches which take an argument don't care whether there is a space
  29.      between the switch and the argument.
  30.  
  31.      For those of you who don't like additional variables being created,
  32.      _g_e_t_o_p_t() and _g_e_t_o_p_t_s() will also accept a hash reference as an optional
  33.      second argument. Hash keys will be x (where x is the switch name) with
  34.      key values the value of the argument or 1 if no argument is specified.
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.