in reply to Stat function returning an empty list

first and always use strict and warnings, and the more powerful debbuging tool i know: print..
as in the following oneliner:
perl -e "opendir my $dir,'.' or die; while ($_ = readdir $dir){@stat = + stat $_; print qq([$_]@stat\n)}"
You must have some problem with $dir, because your posted code, with '.' as value of $dir never print to me "Has no items"

HtH
L*
PS warning if you are on windows stat has some caveats that i dont rememer now.. maybe the module override the built-in or something else

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.