Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!uwm.edu!ogicse!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal L. Schwartz) Newsgroups: comp.lang.perl Subject: Re: does perl have an "in" operator? Message-ID: <1991May15.203033.13975@iwarp.intel.com> Date: 15 May 91 20:30:33 GMT References: <1991May15.153547.9282@iwarp.intel.com> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal L. Schwartz) Distribution: comp Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 20 In-Reply-To: weg@convx1.ccit.arizona.edu (Eythan Weg) In article , weg@convx1 (Eythan Weg) writes: | Can this work too? | | @array = ( 1, 2, 3 ); | print "found one\n" if grep(/1/, @array); | print "found four\n" if grep(/4/, @array); Depends on what you mean by "work"... @array = ( 1, 2, 3, 14 ); print "found four\n" if grep(/4/, @array); prints "found four", because /4/ is true on "14". print "Just another Perl hacker," # rushing to a meeting :-) -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Intel: putting the 'backward' in 'backward compatible'..."====/