home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / perl / 7398 < prev    next >
Encoding:
Internet Message Format  |  1992-12-13  |  1.4 KB

  1. Path: sparky!uunet!olivea!spool.mu.edu!uwm.edu!ogicse!reed!mjeffery
  2. From: mjeffery@reed.edu (Mark Jefferys)
  3. Newsgroups: comp.lang.perl
  4. Subject: In 5.0, are we gonna get...
  5. Message-ID: <1992Dec14.043835.23009@reed.edu>
  6. Date: 14 Dec 92 04:38:35 GMT
  7. Organization: Reed College, Portland, OR
  8. Lines: 31
  9.  
  10. Will we see:
  11.  
  12. 1) an equivalent of lisp's mapcar?  For an instance:
  13.  
  14.     map(/(\d+)/, "asdf 23fjk4", "qwerty", "123 ")
  15.  
  16.    would return ("23", "4", "123").
  17.  
  18.  
  19. 2) a way of only matching the real beginning/end of a *string* in a
  20.    regexp?  Currently, '^' and '$' match the beginning and ending of
  21.    a line (with simplifying assumptions when $* == 0).  A string match
  22.    would ignore newlines and $*.
  23.  
  24.    A new option on pattern matches might do it:  `/^\d+$/s' might match
  25.    "23", but not "23\n" or "x\n45".  The option should treat `.' as
  26.    matching "\n", as well as every other character -- so the option
  27.    means that "\n" should not be treated specially. 
  28.  
  29.  
  30. 3) a pure grouping operator in pattern matches.  Normally, `/Type:
  31.    (\d+|[a-zA-Z])/' will return an element containing the
  32.    `\d+|[a-zA-Z]' (in an array context), and assign $1 to the pattern.
  33.    If this isn't wanted, it will only slow perl down, and possibly
  34.    make life confusing if the pattern is very complex.  One that
  35.    doesn't try to save its contents would be nice.
  36.  
  37.  
  38. Mark
  39. -- 
  40. Mark Jefferys        Internet: mjeffery@reed.edu
  41.