Empty directory: Difference between revisions

→‎Thorough version: Indirect object call is bad, recommend ->new instead.
(→‎Thorough version: Indirect object call is bad, recommend ->new instead.)
Line 296:
===Thorough version===
<lang perl>use IO::Dir;
sub dir_is_empty { (!grep !/^.{1,2}$/, (new IO::Dir(@_))->new->read()) == 0 }</lang>
 
=={{header|Perl 6}}==
Anonymous user