Scalars are either numbers or a string of characters as in C although in both cases there are significant differences
-
numbers and strings are not explicitly typed
-
Note Perl is "safer" than JavaScript in this regard and it is very rare that numbers and strings are confused
|
Numbers are stored internally as integers if this represents them adequately -- otherwise as double-precision numbers
-
Perl and the runtime system make certain that this is transparent to user
-
Wolfram's SMP (the forerunner of Mathematica) at Caltech (which I worked on) also made the more extreme choice of everything being double precision
-
For example 1, 5.0, 4.5E23, and 7.45 E-15, are all numbers
|
Octal and Hexadecimal numbers are allowed with
-
0377 (initial zero) assumed to be octal and so is equal to 255 decimal
-
0X or 0x represents hexadecimal with letters A to F corresponding to numbers 10 to 15 as normal. 0XFF is hex FF or 255 decimal
|