in reply to readdir return nul string

I had my bad time copying your code and reformatting it. Please check the Writeup Formatting Tips and fix your layout to be at least readable.

Your code seems to works fine, readdir returns correct data (neither null?? or undef) and push all the files which ends with '.lip' in the @names array.

Oha

Ps: for other monks, i've put the OP code below

opendir( DIR, $directory ) or die "open dir error"; my $number = 0; while(defined($name = readdir (DIR))) { $number++; if($name eq "") { print "Value -$name* is null string." } print "Loop $number-->$name**\n"; next if $name eq "." || $name eq ".."; next unless $name =~ /(.*)\.lip$/; push @names, $name; }