upload.pl
branchonce
changeset 44 15f109d06ec0
parent 43 f5c765ad2765
child 46 2130f00e34f7
child 89 296eb0085df8
equal deleted inserted replaced
43:f5c765ad2765 44:15f109d06ec0
   243     my @units = qw(B K M G T);
   243     my @units = qw(B K M G T);
   244     while (length int > 3 and @units) {
   244     while (length int > 3 and @units) {
   245         $_ = sprintf "%.1f" => $_ / 1024;
   245         $_ = sprintf "%.1f" => $_ / 1024;
   246         shift @units;
   246         shift @units;
   247     }
   247     }
   248     croak "filesize is too big (can't convert to human readable number"
   248     croak "filesize is too big (can't convert to human readable number)"
   249       if !@units;
   249       if !@units;
   250     return "$_$units[0]";
   250     return "$_$units[0]";
   251 }
   251 }
   252 
   252 
   253 sub confirm {
   253 sub confirm {