In Perl, everything is a scalar. Strings, floats, integers - all the same. You can read a number of any length into such a scalar, but only as a string. As soon as you do arithmetic operations with the scalar, it's converted to a signed int or double value.
Elberet wrote:In Perl, everything is a scalar. Strings, floats, integers - all the same. You can read a number of any length into such a scalar, but only as a string. As soon as you do arithmetic operations with the scalar, it's converted to a signed int or double value.
yep,
right now I do some arithmetics in the size handling though (i.e. to insert the dots before displaying a size value anywhere). I could probably do that with string operations too. However, I am not sure what perl will do on other arithmetic checks which i will still need. (i.e. < and >)
I think Math.BigInt (or Math.BigFloat) package will be enough for this purpose. All operations are covered, maybe conversion BigInt -> string (to write to DB or display) may be improved.