in reply to Re: How do I determine whether a folder is empty?
in thread How do I determine whether a folder is empty?
This won't work, because glob called in scalar context wants to iterate through all the files in a directory, and won't even look at its argument until it finishes. It will remember what directory it was reading on a previous call to is_empty. You could call glob in list context like this:
! (() = glob $_[0] . '/*');
|
|---|