home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!reed!romulus!merlyn
- From: merlyn@romulus.reed.edu (Randal L. Schwartz)
- Newsgroups: comp.lang.perl
- Subject: Re: Problem with order of precedence, maybe
- Message-ID: <MERLYN.92Jul30065305@romulus.reed.edu>
- Date: 30 Jul 92 13:53:08 GMT
- Article-I.D.: romulus.MERLYN.92Jul30065305
- References: <sherman.712450219@foster>
- Sender: news@reed.edu (USENET News System)
- Organization: Reed College
- Lines: 18
- In-Reply-To: sherman@unx.sas.com's message of 29 Jul 92 22:50:19 GMT
-
- In article <sherman.712450219@foster> sherman@unx.sas.com (Chris Sherman) writes:
- According to the perl book, '&' comes before '!=', so theoretically, what
- numbers between 1-4 get hit should result in the same numbers getting hit
- on the second set of statements.
-
- Hmm. According to *my* copy of the Camel Book (presuming that's the
- "perl book" you are talking about), I see "&" at a *lower* precedence
- than "!=", so I'd expected "!=" to bind more tightly, and that is in
- fact what is happening.
-
- I agree, the posted code snippet is incorrect. Not enough parens.
-
- print grep (1 & $_ != 1, split(//, "Just another Perl hacker,")) # odd chars?
-
- --
- Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
- merlyn@reed.edu (guest account) merlyn@ora.com (better for permanent record)
- cute quote: "Welcome to Portland, Oregon -- home of the California Raisins!"
-