home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!cs.utexas.edu!convex!tchrist
- From: Tom Christiansen <tchrist@convex.COM>
- Subject: Re: why is this illegal ??
- Message-ID: <1992Jul31.114814.11016@convex.com>
- Originator: tchrist@convex.convex.com
- Sender: usenet@convex.com (news access account)
- Nntp-Posting-Host: convex.convex.com
- Reply-To: tchrist@convex.COM (Tom Christiansen)
- Organization: CONVEX Realtime Development, Colorado Springs, CO
- References: <1992Jul30.235951.16495@cs.ruu.nl>
- Date: Fri, 31 Jul 1992 11:48:14 GMT
- X-Disclaimer: This message was written by a user at CONVEX Computer
- Corp. The opinions expressed are those of the user and
- not necessarily those of CONVEX.
- Lines: 21
-
- From the keyboard of henkp@cs.ruu.nl (Henk Penning):
- :Perl prog:
- :-----------------------------------------------
- :# why is this illegal ??
- :
- :$res = ( -f ? 'hip' : 'hop' ) ;
- :
- :# what I try to do is: grep plain files from a directory and save the stats
- :# @res = grep( ( -f ? ( $f{$_} = join($;,stat(_)) ) : 0 ) , readdir(DIR) ) ;
- :-----------------------------------------------
-
- Because sometimes you can't let the operand default.
-
- $res = ( (-f $_) ? 'hip' : 'hop' ) ;
-
- --tom
- --
- Tom Christiansen tchrist@convex.com convex!tchrist
-
- /* dbmrefcnt--; */ /* doesn't work, rats */
- --Larry Wall in hash.c from the perl source code
-