Perl uses double indirection. Simply put, a Perl variable actually has two variables - the thing that can hold a number and the thing that can hold a string. (It's actually possible to have the two of them be out of sync internally, though you'll never see it unless you deliberately peek behind the curtain.) So, when you do a "stringy" operation, the variable will act like a string. If you do a "nummy" operation, it will act like a number. It does the itoa() and atoi() conversions for you, grows for you (with realloc() and similar functions), etc etc etc.