Help for this page

Select Code to Download


  1. or download this
    subroutine says this is your hash: 
    key: ./stat1.pl, value: HASH(0xa1519ac)
    
  2. or download this
    my %stat = map {
        $_ => {
            r => (-r $_),
    ...
            s => (-s $_),
        }
    } @files;
    
  3. or download this
    my %stat = map {
        lstat($_) or die "Can't lstat $_: $!";
        $_ => {
    ...
            s => (-s _),
        }
    } @files;
    
  4. 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';
    }