Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Possible bug with shifting an array Message-ID: <9133@jpl-devvax.JPL.NASA.GOV> Date: 14 Aug 90 06:16:43 GMT References: <12150004@hpcc01.HP.COM> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 16 In article <12150004@hpcc01.HP.COM> okamoto@hpcc01.HP.COM (Jeff Okamoto) writes: : #!/usr/bin/perl : : $i = 0; : @a = ( "", "", "Hello" ); : : while($a[0] == "" && $i < 100) { : shift(@a); : $i++; : } : print "Found it at position $i\n"; Change the == to eq and it should work better. A -w would have pointed this out, by the way. Larry