home *** CD-ROM | disk | FTP | other *** search
- 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
- dov
- From: dov@menora.weizmann.ac.il (Dov Grobgeld)
- Newsgroups: comp.lang.perl
- Subject: Re: sorting problem
- Message-ID: <1992Nov15.141016.4803@wisipc.weizmann.ac.il>
- Date: 15 Nov 92 14:10:16 GMT
- References: <1992Nov12.211431.6740@news.eng.convex.com>
- Sender: news@wisipc.weizmann.ac.il
- Organization: Weizmann Institute of Science, Computation Center.
- Lines: 25
-
- tchrist@convex.COM (Tom Christiansen) writes:
- : :
- :
- : for (@data) { push(@idx, /^[^;]*;(.*)/) }
- ^^^^^^^^^^^^
- According to the book m// returnes true (1) or false (''). So I guess
- that the expression should really be
-
- for (@data) { push(@idx, (/^[^;]*;(.*)/, $1)) }
-
- or
-
- for (@data) { /^[^;]*;(.*)/ && push(@idx, $1) }
-
- or perhaps
-
- @idx=@data && grep( s/^[^;]*;(.*)/$1/, @idx);
-
- --
- ___ ___
- / o \ o \
- Dov Grobgeld ( o o ) o |
- The Weizmann Institute of Science, Israel \ o /o o /
- "Where the tree of wisdom carries oranges" | | | |
- _| |_ _| |_
-