in reply to Stat and file size

Perhaps the following -size File Test Operator and grep on a glob will work for you:

my @nonZeroSizeFiles = grep -s, <*>;

And in case you'd like to find zero-size files

my @zeroSizeFiles = grep !-s, <*>;

Hope this helps!

Replies are listed 'Best First'.
Re^2: Stat and file size
by jwkrahn (Abbot) on Jul 29, 2012 at 06:45 UTC

    And in case you'd like to find zero-size files

    my @zeroSizeFiles = grep !-s, <*>;
    my @zeroSizeFiles = grep -z, <*>;
Re^2: Stat and file size
by Ormus (Initiate) on Jul 28, 2012 at 20:01 UTC
    Not sure how I would use that Kenosis, sorry

      Here's one way to use it:

      use strict; use warnings; my $dir = './'; my @nonZeroLengthFiles = grep -s, <$dir*>; print "$_\n" for @nonZeroLengthFiles;

      This will print a list of all zero-length files in $dir.