Date: Wed, 04 Jul 2001 17:23:28 -0700 From: "Godzilla!" Subject: Re: clean up an array of references from references which are pointing into empty arrays Message-Id: <3B43B380.8D7ED0AB@stomp.stomp.tokyo> Alexvalara wrote: > the problem now is that having an array of arrays you want to get > rid of empty arrays of the array! You want to do this. I do not. Your use of "that" in your sentence causes me to gnash my English teacher teeth. Tell me, why would you "get" then "rid" something? Rather oxymoronic, don't you think? > For example, you have something like > @a=(\@b,\@c,\@d...) where \@c=("") > and you want to come up with an arrayof the following form > (\@b,\@d...). I do not have "something like" that. You do. You want to do this. I do not. > Any suggestions...? A suggestion would be to write code of your own, then ask for help if needed. Show some effort. Laziness is not well accepted within this group, least not by me, no more than trolls are accepted, again, least by me. I personally have provided you with more than enough information to accomplish this in prior articles, for which, I have received no acknowledgement from you and, clearly, you have invested zero effort to adapt. Godzilla! Queen Of Semantic Guerrillas. -- TEST SCRIPT: ____________ #!perl print "Content-type: text/plain\n\n"; @Array_A = (1, 2, 3); @Array_B = (4, 5, 6); @Array_C = (); @Array_D = (7, 8, 9); @Array_E = (\@Array_A, \@Array_B, \@Array_C, \@Array_D); print "Control: @Array_E\n\n"; foreach $reference (@Array_E) { $non_null = shift (@Array_E); if ($#{ $non_null } > -1) { push (@Array_E, $non_null); } } print "First Results: @Array_E)\n\n"; @Array_E = sort (@Array_E); print "Final Results: @Array_E\n\n"; exit; PRINTED RESULTS: ________________ Control: ARRAY(0x1a62644) ARRAY(0x1a626a4) ARRAY(0x1a62704) ARRAY(0x1a62740) First Results: ARRAY(0x1a62740) ARRAY(0x1a62644) ARRAY(0x1a626a4)) Final Results: ARRAY(0x1a62644) ARRAY(0x1a626a4) ARRAY(0x1a62740)