home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!convex!convex!tchrist
- From: Tom Christiansen <tchrist@convex.COM>
- Subject: Re: nuther perl-idiom question..
- Originator: tchrist@pixel.convex.com
- Sender: usenet@news.eng.convex.com (news access account)
- Message-ID: <1992Sep2.141142.14599@news.eng.convex.com>
- Date: Wed, 2 Sep 1992 14:11:42 GMT
- Reply-To: tchrist@convex.COM (Tom Christiansen)
- References: <Btx90n.BMG@unx.sas.com> <1992Sep1.232723.5911@news.eng.convex.com> <1992Sep2.001759.7304@cs.ubc.ca>
- Nntp-Posting-Host: pixel.convex.com
- Organization: Convex Computer Corporation, Colorado Springs, CO
- 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: 23
-
- From the keyboard of dhami@cs.ubc.ca (Mandeep S Dhami):
- :>In Perl, one often writes:
- :> $x = $foo || "default";
- :As long as you can be assured that $foo is not the string "0"!
-
- Yes, well, I consider that false, as are defined nulls.
- I think as long as you're aware that it works this way,
- it's ok.
-
- How often do you say
-
- while (defined($_ = <>)) {
-
- }
-
- which you technically should lest the last line be a lone zero?
-
- --tom
- --
- Tom Christiansen tchrist@convex.com convex!tchrist
-
- You want it in one line? Does it have to fit in 80 columns? :-)
- --Larry Wall in <7349@jpl-devvax.JPL.NASA.GOV>
-