http://www.perlmonks.org?node_id=1158502


in reply to Unifying namespaces of @name and $name to simplify dereferencing?

Are there any pitfalls I didn't think of regarding this hypothetical feature?

This would allow either the association of $identifier with @identifier or %identifier, but not both. To allow both, hashes and arrays have to collapse into one data structure, which is what php does. I personally detest this particular php feature. Associating both makes sigils meaningless imho and kicks you back into C where an identifier can hold an address or a pointer to anything including a function, making it impossible to grasp at first glance what the identifier is about. But this is one of the very reasons sigils denoting variable types were introduced in perl (borrowing that from basic) - which makes your suggestion going against the camel's hair, IMHO.

It would make a good perl-critic rule to disallow the use of the same identifier for different purposes, though.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'