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 / Text::ParseWords.z / Text::ParseWords
Encoding:
Text File  |  1998-10-30  |  1.9 KB  |  67 lines

  1.  
  2.  
  3.  
  4. TTTTeeeexxxxtttt::::::::PPPPaaaarrrrsssseeeeWWWWoooorrrrddddssss((((3333))))                                        TTTTeeeexxxxtttt::::::::PPPPaaaarrrrsssseeeeWWWWoooorrrrddddssss((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Text::ParseWords - parse text into an array of tokens
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.        use Text::ParseWords;
  13.        @words = "ewords($delim, $keep, @lines);
  14.        @words = &shellwords(@lines);
  15.        @words = &old_shellwords(@lines);
  16.  
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      &_q_u_o_t_e_w_o_r_d_s() accepts a delimiter (which can be a regular expression) and
  20.      a list of lines and then breaks those lines up into a list of words
  21.      ignoring delimiters that appear inside quotes.
  22.  
  23.      The $keep argument is a boolean flag.  If true, the quotes are kept with
  24.      each word, otherwise quotes are stripped in the splitting process.  $keep
  25.      also defines whether unprotected backslashes are retained.
  26.  
  27.      A &_s_h_e_l_l_w_o_r_d_s() replacement is included to demonstrate the new package.
  28.      This version differs from the original in that it will _NOT_ default to
  29.      using $_ if no arguments are given.  I personally find the old behavior
  30.      to be a mis-feature.
  31.  
  32.      &_q_u_o_t_e_w_o_r_d_s() works by simply jamming all of @lines into a single string
  33.      in $_ and then pulling off words a bit at a time until $_ is exhausted.
  34.  
  35. AAAAUUUUTTTTHHHHOOOORRRRSSSS
  36.      Hal Pomeranz (pomeranz@netcom.com), 23 March 1994
  37.  
  38.      Basically an update and generalization of the old shellwords.pl.  Much
  39.      code shamelessly stolen from the old version (author unknown).
  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.