Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!spool2.mu.edu!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: null? or not null? Message-ID: <11124@jpl-devvax.JPL.NASA.GOV> Date: 19 Jan 91 20:51:10 GMT References: Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 27 In article rm55+@andrew.cmu.edu (Rudolph T. Maceyko) writes: : while (($a,$b) = (&function)[7,8]) { : : My problem is that the condition is always true! : ... : So how do I do what I want to do without using "dummy" variables like : this: : : while (($x,$y,$z,$a,$b) = &function) { There's More Than One Way To Do It: while (($a,$b) = grep(defined, (&function)[7,8])) while (($a,$b) = (&function)[7,8], defined $a) while (grep(defined, ($a,$b) = (&function)[7,8])) while (join(' ', ($a,$b) = (&function)[7,8])) If $a will always be true on successful return: while (($a,$b) = (&function)[7,8], $a) while ((($a,$b) = (&function)[7,8])[0]) Larry