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

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!concert!gatech!bloom-beacon!eru.mt.luth.se!lunic!sunic!mcsun!ub4b!news.cs.kuleuven.ac.be!blekul11!frmop11!barilvm!vms.huji.ac.il!wisipc.weizmann.ac.il!menora.weizmann.ac.il
  2.  dov
  3. From: dov@menora.weizmann.ac.il (Dov Grobgeld)
  4. Newsgroups: comp.lang.perl
  5. Subject: Re: sorting problem
  6. Message-ID: <1992Nov15.141016.4803@wisipc.weizmann.ac.il>
  7. Date: 15 Nov 92 14:10:16 GMT
  8. References: <1992Nov12.211431.6740@news.eng.convex.com>
  9. Sender: news@wisipc.weizmann.ac.il
  10. Organization: Weizmann Institute of Science, Computation Center.
  11. Lines: 25
  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.      for (@data) { push(@idx, (/^[^;]*;(.*)/, $1)) }
  22.  
  23. or
  24.  
  25.      for (@data) { /^[^;]*;(.*)/ && push(@idx, $1) }
  26.  
  27. or perhaps
  28.  
  29.     @idx=@data && grep( s/^[^;]*;(.*)/$1/, @idx);
  30.  
  31. --
  32.                                                         ___   ___
  33.                                                       /  o  \   o \
  34. Dov Grobgeld                                         ( o  o  ) o   |
  35. The Weizmann Institute of Science, Israel             \  o  /o  o /
  36. "Where the tree of wisdom carries oranges"              | |   | |
  37.                                                        _| |_ _| |_
  38.