by azangru · 3y ago · 0 comments
The mandatory dollar sign in variable names looks dumb in php, I grant you that. As well as the dot for string concatenation. But perl insists on the distinction between $variable, @variable, and %variable; which is just wild. How is it that python works fine without all that noise, for chrissake? Or javascript?
You would prefer *ref like in C? You can actually do that (it's a GLOB type).
The place people get tripped up is that $scalar can be a string, or a ref.
You check that easily with ref $scalar eq 'ARRAY' or whatever guard you want.