From: Jason Creighton Date: 2003-09-20T06:20:21+09:00 Subject: Re: Removing "nil" entries from array On Fri, 19 Sep 2003 22:54:24 +0900 Thomas Adam wrote: > Dear All, > > I have a really weird situation. I'm reading a file into an array, based > on a grep match. This works fine..... > > ..yet I re-ran my program using the same data file (unchanged) and now my > array is being intermittently populated with "nil" values. Using "uniq()" > doesn't remove them. Any ideas? Well, as several people have mentioned, you could use Array#compact, but if I were you, I would try to find out why you're getting nil values. Could you post the smallest possible code snippet + data that shows this problem? Jason Creighton