home *** CD-ROM | disk | FTP | other *** search
- 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
- From: ej@id.dth.dk (Erik Johansen)
- Newsgroups: comp.lang.perl
- Subject: Re: sorting problem
- Message-ID: <ej.722072980@id.dth.dk>
- Date: 18 Nov 92 07:49:40 GMT
- References: <1992Nov12.211431.6740@news.eng.convex.com> <1992Nov15.141016.4803@wisipc.weizmann.ac.il>
- Organization: Department of Computer Science
- Lines: 24
-
- dov@menora.weizmann.ac.il (Dov Grobgeld) writes:
-
- >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
-
- No, that is not (totally) correct. According to the manual the value returned
- can also be a list of ($1, $2, $3...) :
-
- If used in a context that requires an array value, a pattern
- match returns an array consisting of the subexpressions matched
- by the parentheses in the pattern, i.e. ($1, $2, $3...). It
- does NOT actually set $1, $2, etc. in this case, nor does it set
- $+, $`, $& or $'. If the match fails, a null array is returned.
- If the match succeeds, but there were no parentheses, an array
- value of (1) is returned.
-
- --
- Erik Johansen / Institute for Computer Science / Danish Technical University
- ej@id.dth.dk
-