You mean something like this, using hash to get all the statistics you need:
use warnings; use strict; use File::Find qw(find); use Data::Dumper; # don't fix the directory my $start_dir = $ARGV[0] || '.'; my $ext = qr[\.[^.]+]; find( \&finder => $start_dir ); my %file; # hash to collect statistics sub finder { return if $_ eq '.'; if (/($ext)/) { my $size = -s; $file{$1}++; $file{size}{$1} += $size; } } { local $Data::Dumper::Sortkeys = 1; print Dumper \%file; }
In reply to Re^3: Perl Directory file extension stats.
by 2teez
in thread Perl Directory file extension stats.
by sidsinha
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |