3 ms·
The 'problem' with Perl's type indicators are that it's slightly unintuitive to, say, create a hash using %, but to access a hash (and return a variable) you us
by halo 19y ago
The 'problem' with Perl's type indicators are that it's slightly unintuitive to, say, create a hash using %, but to access a hash (and return a variable) you use $, so the punctuation indicates the return type rather than the type you are accessing and might not make sense without context. Whatsmore, it requires you to remember two things - the type of brackets required and the return type, one of which is largely redundant.
Incidentally, I'm pretty sure they're changing this with Perl 6 and making it to that the symbol indicates the type you are accessing. I'm split as to whether this is a good idea or not, especially as they're retaining the still largely redundant curly brackets when ordinary brackets will now do.