home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / perl / 5012 < prev    next >
Encoding:
Text File  |  1992-07-28  |  891 b   |  24 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!gatech!psuvax1!flee
  3. From: flee@cs.psu.edu (Felix Lee)
  4. Subject: Re: Truncating or rounding "floats" and bug with ($_==int?2:3)
  5. Message-ID: <Bs4zo9.6qE@cs.psu.edu>
  6. Sender: news@cs.psu.edu (Usenet)
  7. Nntp-Posting-Host: dictionopolis.cs.psu.edu
  8. References: <nomi.712368419@pooh.mmwb.ucsf.edu> <rantapaa.712384725@s6.math.umn.edu>
  9. Date: Wed, 29 Jul 1992 07:07:18 GMT
  10. Lines: 12
  11.  
  12. Erik E. Rantapaa:
  13. > BTW, the following gives a syntax error (SunOS, patchlevel 19):
  14. > ( $_==int ? 2 : 3)
  15.  
  16. That's because 'int' expects an argument, and '?' in an argument
  17. position is the '?PATTERN?' operator, not the '?:' operator.
  18.  
  19. Perl 4.0 pl 35 gives this message for the above statement:
  20. > Warning: Use of "int" without parens is ambiguous at - line 1.
  21. > Search pattern not terminated in file - at line 1, next char ^?
  22. > syntax error in file - at line 2, next char ;
  23. --
  24.