How does a scalar know what it is?



In C, I can just read the K&R book and know
how everything is pretty much coded at the
machine level. At least to some extent.

But how does Perl know when you type

print $ref

for example that it is not an integer, string or what have
you?

And how does

print $num; 2 or "Two"

again at the machine level, how does perl know
what it has?




.



Relevant Pages