in reply to readdir return nul string
Thanks oha for the clean version of the code.opendir( DIR, $directory ) or die "open dir error"; my $number = 0; while(defined($name = readdir (DIR))) { if($name eq "") { print "Value -$name* is null string." } print "Loop $number-->$name**\n"; next if $name eq "." || $name eq ".."; $number++; next unless $name =~ /(.*)\.lip$/; push @names, $name; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: readdir return nul string
by marscld (Beadle) on Sep 26, 2007 at 13:15 UTC |