home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!usc!sol.ctr.columbia.edu!eff!ckd
- From: ckd@eff.org (Christopher Davis)
- Subject: Re: help with if ( ! $a =~ /##/ ) PLEASE!!!
- In-Reply-To: ericw@bach.amd.com's message of 27 Aug 92 20:02:55 GMT
- Message-ID: <CKD.92Aug27231701@loiosh.eff.org>
- Sender: usenet@eff.org (NNTP News Poster)
- Nntp-Posting-Host: loiosh.eff.org
- Organization: Electronic Frontier Foundation Tech Central
- References: <ericw.714945775@bach>
- Distribution: usa
- Date: Fri, 28 Aug 1992 03:17:03 GMT
- Lines: 23
-
- Eric> == Eric Wedaa <ericw@bach.amd.com>
-
- Eric> I am having a h!@# of a time getting this code fragment to
- Eric> work:
-
- Eric> if ( ! $a =~ /#/ ){
- Eric> some_random_bit_of_perl;
- Eric> }
-
- Eric> It never does anything! What I want it to do is if $a does not
- Eric> have "#" in it, then it should do "some_random_bit_of_perl;"
-
- Why not do this instead:
-
- if ($a !~ /#/) {
- some_random_bit_of_perl;
- }
-
- This is (IMHO) cleaner than a test-and-negate.
- --
- Christopher Davis * ckd@eff.org * System Administrator, EFF * +1 617 864 0665
- ``Ed Gruberman, you fail to grasp Ti Kwan Leep.
- Approach me that you might see.'' -- The Master
-