#!/usr/bin/perl -l
use strict;
use warnings;
use File::Find;
@ARGV=grep {-d or !warn "`$_': not a directory!\n"} @ARGV;
die "Usage: $0
[]\n" unless @ARGV;
my ($tot,$maxsz,$max,$n)=(0,0);
find { no_chdir => 1,
wanted => sub {
return unless -f;
$n++;
$tot += my $sz=-s;
($max,$maxsz)=($_,$sz) if $sz >= $maxsz;
} }, @ARGV;
die "Found 0 files\n" unless $n;
print <<"EOF";
Total files found: $n
Total size: $tot
Largest file: `$max' (size: $maxsz bytes)
EOF
__END__