my $KiB = <>; my @pref = qw(M G T P);my $i = 0; while($i<@pref){last if $KiB/1024 < 1; $KiB/=1024;$i++} print "$KiB$pref[$i]iB\n"