home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / perl / 5054 < prev    next >
Encoding:
Text File  |  1992-07-31  |  1.4 KB  |  39 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!cs.utexas.edu!convex!tchrist
  3. From: Tom Christiansen <tchrist@convex.COM>
  4. Subject: Re: why is this illegal ??
  5. Message-ID: <1992Jul31.114814.11016@convex.com>
  6. Originator: tchrist@convex.convex.com
  7. Sender: usenet@convex.com (news access account)
  8. Nntp-Posting-Host: convex.convex.com
  9. Reply-To: tchrist@convex.COM (Tom Christiansen)
  10. Organization: CONVEX Realtime Development, Colorado Springs, CO
  11. References: <1992Jul30.235951.16495@cs.ruu.nl>
  12. Date: Fri, 31 Jul 1992 11:48:14 GMT
  13. X-Disclaimer: This message was written by a user at CONVEX Computer
  14.               Corp. The opinions expressed are those of the user and
  15.               not necessarily those of CONVEX.
  16. Lines: 21
  17.  
  18. From the keyboard of henkp@cs.ruu.nl (Henk Penning):
  19. :Perl prog:
  20. :-----------------------------------------------
  21. :# why is this illegal ??
  22. :
  23. :$res = ( -f ? 'hip' : 'hop' ) ;
  24. :
  25. :# what I try to do is: grep plain files from a directory and save the stats
  26. :# @res = grep( ( -f ? ( $f{$_} = join($;,stat(_)) ) : 0 ) , readdir(DIR) ) ;
  27. :-----------------------------------------------
  28.  
  29. Because sometimes you can't let the operand default.  
  30.  
  31.     $res = ( (-f $_) ? 'hip' : 'hop' ) ;
  32.  
  33. --tom
  34. -- 
  35.     Tom Christiansen      tchrist@convex.com      convex!tchrist
  36.  
  37.             /* dbmrefcnt--;  */     /* doesn't work, rats */
  38.         --Larry Wall in hash.c from the perl source code
  39.