# makes no difference return if glob "'${directory}/*'"; # with this construct it works! my @files = glob("$directory/*"); return if scalar @files; # doesn't work either - prints "hi hi if ( glob("$directory/*") ) { print "hi\n"; return; }