subroutine says this is your hash:
key: ./stat1.pl, value: HASH(0xa1519ac)
####
my %stat = map {
$_ => {
r => (-r $_),
w => (-w $_),
x => (-x $_),
s => (-s $_),
}
} @files;
####
my %stat = map {
lstat($_) or die "Can't lstat $_: $!";
$_ => {
r => (-r _),
w => (-w _),
x => (-x _),
s => (-s _),
}
} @files;
####
use v5.12;
use File::stat 1.02 qw( stat lstat );
# ...
my %stat = map { $_ => lstat($_) } @files;
# ...
for my $fn (@files) {
say $fn,' is ',(-d $stat{$fn} ? 'a directory' : -x $stat{$fn} ? 'executable' : '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 size of ',$stat{$fn}->blksize(),' bytes';
}