in reply to Problems with blank lines

First, are you sure your @dir array really has blank lines in it? Is it possible that some of your strings have newlines on the end of them? Try using Data::Dumper to get a full view of the actual contents of your array. If the problem is in fact trailing newlines, then you might want to use chomp when inserting the strings into your array.

Replies are listed 'Best First'.
Re^2: Problems with blank lines
by jakeeboy (Sexton) on Nov 30, 2005 at 16:50 UTC
    I didn't know that reading in a directory there would be new lines. But I'll try chomping them when I create the @objects array from readdir. Thanks