use File::Slurp; if ( read_dir('/path/to/dir') == 0 ) { print "is empty!\n"; }