Date: Wed, 04 Jul 2001 13:56:01 -0700 From: "Godzilla!" Subject: Re: clean up array from "holes"... Message-Id: <3B4382E1.5FFD649B@stomp.stomp.tokyo> Godzilla! wrote: > Alexvalara wrote: (dietary snippage) > > Is it possible to get rid off "holes" in an array.... > Those "holes" are referred to as null elements > and a host of other geeky terms of endearment. > Piece of cake. This method I exemplify works very nice > for small to small-medium size arrays. I would suggest > a different method for large arrays.... > For large arrays, it would be more logical to simply > push non-null elements into a new array. However, > would not you then have two large arrays for a period > of time? I would say, > "Half a dozen of one, a Baker's Dozen of the other." > Imaginative use of shift will turn these large fattening > half dozens into a small delicious cream puff; > push it in, shift it out. I hear a Sissified Geek whimpering "Aunt" over and over... These Sissified Geeks know to cry "Aunt" rather than "Uncle" simply because I cannot be an uncle, nor an aunt, actually, although some Sissified Geeks claim me to be a pissant. You boys just don't know how to turn your fat beer bloated arrays into tasty little champagne cream puffs, like mine. This method might be of interest to those whom have such difficulty dealing with disproportionately large arrays; an intellectual dietary method. Godzilla! Queen Of The Shifty. -- TEST SCRIPT: ____________ #!perl print "Content-type: text/plain\n\n"; @Array = ("Godzilla", "", "Rocks", "And", "", "Rolls", "", "!", "", "0", "¿", "0"); $element_count = $#Array; for ($iterate = 0; $iterate <= $element_count; $iterate++) { $non_null = shift (@Array); if ($non_null ne "") { push (@Array, $non_null); } } print "@Array"; exit; PRINTED RESULTS: ________________ Godzilla Rocks And Rolls ! 0 ¿ 0