2 ms·
One of the functions of sigils is to serve as mini namespaces. While your example might be technically possible, it means that variable names can now clash with
by perlgeek 9y ago
One of the functions of sigils is to serve as mini namespaces. While your example might be technically possible, it means that variable names can now clash with function and type names (something that I, as a long-term Perl programmer, find very inconvenient in Python).
Another complication is that Perl uses predictive parsing. It always knows whether the next thing it expects is an operator or a term. That's what allows the use of / for both the division operator and a delimiter for regexes. After a variable, the parser always expects an operator. After a function name it expects a term (because you can leave out the parens in a function call, foo($bar); being the same as foo $bar;).
While there are a few exceptions to that rule (like subroutines with empty prototypes), introducing many exceptions through unsigiled variables might lead to code that's not very intuitive to parse anymore. (Or might not; might an interesting experiment).