File checking

Hi,

I have to check file is available in particular directory.

if ( -d $dir ){
  print "It will say that is dir ";
else 
  print "It will say that is not dir";
}

Not like this. I want to check that dir having files or not ?

Please advice

Thanks,
Mani

count=$(find ${dir} -type f | wc -l)

if the $count value is zero, then directory is empty, otherwise its having some file