use warnings; use strict; use File::Slurp qw(read_dir); my @files = sort { -s $a <=> -s $b } grep { -f } read_dir('./');
It filters out directories (even . and ..). I'm not sure why you are getting that warning.
In reply to Re: Sort directory by file size
by toolic
in thread Sort directory by file size
by nnigam1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |