home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!usc!news.cerf.net!netlabs!lwall
- From: lwall@netlabs.com (Larry Wall)
- Subject: Re: Perl range operator
- Message-ID: <1992Dec31.205009.26114@netlabs.com>
- Keywords: range
- Sender: news@netlabs.com
- Nntp-Posting-Host: scalpel.netlabs.com
- Organization: NetLabs, Inc.
- References: <1992Dec30.131700@se28.wg2.waii.com>
- Date: Thu, 31 Dec 1992 20:50:09 GMT
- Lines: 14
-
- 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?
-
- So that @x = ($min .. $max) doesn't suddenly do counterintuitive things when
- $max decreases to less that $min. You can always do what you want with
-
- @x = reverse(1..10);
-
- Larry
-