Why use perl for a thing like this?
# cd /home
# du -sk *
BTW as an addition to what JRF said, a perl way to check the size of a file without a system call or perl function, is using '-s $file', which will return the size of $file
--8<--- untested braindump:
use strict;
use warnings;
use File::Find;
chdir "/home";
my $space;
foreach my $user (glob "*) {
find (sub { $space{$user} += -s $_ },$user);
}
printf "%9d %s\n", $space{$_}, $_ for sort { $space{$a} <=> $space{$b} } keys %space;
-->8---
Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn