or download this
use v5.12;
use File::stat 1.02 qw( stat lstat );
...
say $fn,' is ',(-d $stat{$fn} ? 'a directory' : -x $stat{$fn} ? 'exe
+cutable' : 'not executable');
say $fn,' has a size of ',$stat{$fn}->size(),' bytes, uses ',$stat{$
+fn}->blocks(),' "blocks" of 512 bytes, the filesystem uses a block si
+ze of ',$stat{$fn}->blksize(),' bytes';
}