home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!uwm.edu!spool.mu.edu!hri.com!noc.near.net!meiko.com!mike
- From: mike@meiko.com (Mike Stok)
- Newsgroups: comp.lang.perl
- Subject: Re: Perl range operator
- Keywords: range
- Message-ID: <1992Dec30.213957.12963@meiko.com>
- Date: 30 Dec 92 21:39:57 GMT
- References: <1992Dec30.131700@se28.wg2.waii.com>
- Sender: news@meiko.com
- Organization: Meiko Scientific Corp.
- Lines: 23
-
- In article <1992Dec30.131700@se28.wg2.waii.com> starr@wg2.waii.com writes:
- >In some recent work I was doing, I noticed the following:
- >
- > @x = (10..1);
- >
- >doesn't generate the range 10 -> 1, as one might expect. Is there a
- >reason it doesn't work this way?
-
- 'cos it uses the magical autoincrement algorithm (according to p90 of
- the Camel book), and autodecrement isn't magical (p81)...
-
- Not to worry,
-
- @x = reverse (1 .. 10);
-
- is not too obscure :-)
-
- Mike
- --
- The "usual disclaimers" apply. |
- Mike Stok |
- mike@meiko.com |
- Meiko tel: (617) 890 7676 |
-