in reply to Re: Getting the size of files and stuff
in thread Getting the size of files and stuff

You should get a warning that readdir might return "false" values, e.g. a file named "0".

while(defined(my $file = readir DIR)){

Anyway it's better to use File::Find.