Are you trying to sum up the total? Rather than this:
$total = ($st->size)/1048576;#converts from bytes to MBDo you want this?
$total += ($st->size)/1048576;#converts from bytes to MBI would recommend collecting the total first and then dividing by 1M.
Also, you should declare $total in the scope of the size function so that it will start at zero each time you press the size button.
Update Added more comments
Still Unemployed!
In reply to Re: Finding the size of a directory
by osunderdog
in thread Finding the size of a directory
by Real Perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |