home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / perl / 7037 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.4 KB

  1. Path: sparky!uunet!usc!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sunic!dkuug!cri.dk!id.dth.dk!ej
  2. From: ej@id.dth.dk (Erik Johansen)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: sorting problem
  5. Message-ID: <ej.722072980@id.dth.dk>
  6. Date: 18 Nov 92 07:49:40 GMT
  7. References: <1992Nov12.211431.6740@news.eng.convex.com> <1992Nov15.141016.4803@wisipc.weizmann.ac.il>
  8. Organization: Department of Computer Science
  9. Lines: 24
  10.  
  11. dov@menora.weizmann.ac.il (Dov Grobgeld) writes:
  12.  
  13. >tchrist@convex.COM (Tom Christiansen) writes:
  14. >: :
  15. >:
  16. >:     for (@data) { push(@idx, /^[^;]*;(.*)/) }
  17. >                                ^^^^^^^^^^^^
  18. >According to the book m// returnes true (1) or false (''). So I guess
  19. >that the expression should really be
  20.  
  21. No, that is not (totally) correct. According to the manual the value returned
  22. can also be a list of ($1, $2, $3...) :
  23.  
  24.              If used in a context that requires an array value, a pattern
  25.              match returns an array consisting of the subexpressions matched
  26.              by the parentheses in the pattern, i.e. ($1, $2, $3...).  It
  27.              does NOT actually set $1, $2, etc. in this case, nor does it set
  28.              $+, $`, $& or $'.  If the match fails, a null array is returned.
  29.              If the match succeeds, but there were no parentheses, an array
  30.              value of (1) is returned.
  31.  
  32. -- 
  33. Erik Johansen / Institute for Computer Science / Danish Technical University
  34. ej@id.dth.dk
  35.