Well, I tried also this, ...snip... foreach my $dir (@directories) { find(\&wanted, $dir); ### Not sure how that worked as you called it $directory print "The total size of the file in $dir is " . sprintf("%.2f Kb", ($total_size_of_files_in_dir * 0.0009765625)) . "\n"; print "The total size of the file in $dir is " . sprintf("%.2f Mb", (&size_in_mb($total_size_of_files_in_dir))) . "\n"; }
sub wanted { if (-f $_) { $total_size_of_files_in_dir += -s; } } sub size_in_mb { my $size_in_bytes = shift; return $size_in_bytes / (1024 * 1024); } ...snip... same results and I can't figure out what would be the bug here. -L 2009/3/5 Gunnar Hjalmarsson <nore...@gunnar.cc> > Lauri Nikkinen wrote: > >> ... from this script I get >> >> The total size of the file in etc is 15712.35 Kb >> The total size of the file in etc is 15.34 Mb >> >> and when I check this from Win XP Explorer (folder properties) window I >> get >> >> Size: 372 KB (380 928 bytes) >> >> What is the reason for this difference? >> > > Probably a bug in the code. ;-) Which measures have you taken to try to > find the bug? > > -- > Gunnar Hjalmarsson > Email: http://www.gunnar.cc/cgi-bin/contact.pl > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > >