3 ms·
It's to distinguish between references and non-references. pass-by-reference rather than only COW (such as in some languages) is quite useful. You would prefe
by troglodynellc 3y ago
It's to distinguish between references and non-references. pass-by-reference rather than only COW (such as in some languages) is quite useful.
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.