opendir my $dir, $dirname or die $!; if( grep ! /^\.\.?$/, readdir $dir ){ print 'stuff in here'; }