@folders = grep {/ome/} readdir DIR; $c=0; foreach $folder (@folders) { $c++; } if ($c==0) { ...