Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!bfmny0!tneff From: tneff@bfmny0.UU.NET (Tom Neff) Newsgroups: comp.lang.perl Subject: Re: strings in boolean context Message-ID: <15299@bfmny0.UU.NET> Date: 29 Mar 90 06:38:36 GMT References: Reply-To: tneff@bfmny0.UU.NET (Tom Neff) Lines: 16 I wonder if it would be inviting disaster to suggest that "quoting" an expression always force string context rather than integer. So $x = 0; print "Just another " unless $x; print "Perl hacker," if "$x"; would yield output that makes Randal happy. :-) Right now 0 and "0" both evaluate false, while 00 is false and "00" true. Of course you can 'say what you mean' and use ($x ne "") instead, which might even be better programming practice in many cases... -- If the human mind were simple enough to understand, =)) Tom Neff we'd be too simple to understand it. -- Pat Bahn ((= tneff@bfmny0.UU.NET