kidd has asked for the wisdom of the Perl Monks concerning the following question:
Recently I've been learning Java, and right now im looking at how Java variables work.
For example, when you initialize a variable in Java you must first define what kind of values that variable can hold:
int i = 10; short s = 24000;
When you initialize a variable, Java makes a block of space in the memory for that variable knowing how much space it can hold.
But in perl, we have a "universal" variable, for example a string ($) can hold ints, strings, floats, almost anykind of data. So you can do something like this:
my $stringa = 1234; $stringb = "Hello"; $stringa = $stringb; #No cast problem
Knowing this, my question is: How does perl work with variables?
I've been thinking that when perl makes some space for a variables, it still has to keep in mind that the variable might change in size.
I tried to find some article on the web, but without success.
THANKS