Isn't that just a half-assed mandatory Hungarian-notation system? :-/
I mean, sure, in Perl the language "casts" the value into an appropriate type for you, but only in a few select cases..
I mean, sure, in Perl the language "casts" the value into an appropriate type for you, but only in a few select cases..
For me, the main advantages of sigils are that I can immediately see if I am looking at a variable or a function name and that the sigil effectively separates the name spaces between functions and variables. This has the side effect of making it easy to distinguish functions that have been passed in as variables from functions declared or imported into the particular scope.
Even with a nice IDE I miss the distinction that the sigils provide.
foo.bar = 1
Is that just an attribute set on an object, is it calling a method foo that returns an object containing a bar attribute with a normal getter/setter, or is bar= a method that has arbitrary functionality?I also like the more explicit operators in Perl that help show context:
$foo + $bar
This is specifically numeric addition and those operands are probably at least somewhat number-like. Yes you can potentially overload it, but by convention, it will still be something like addition, so you don't have to wonder if you are adding, concatenating, appending a list, or something else, because they have different operators.