in reply to Static typing is mostly a waste of time
Now, the big reply is "But scalars are strings and numbers and Perl implicitly converts between them." Yes, it does. However, look at it this way - there is a type called scalar. There are dozens of operators that work on scalars. Some of them work with the scalar one way and some work with it another way. The fact they treat the scalar differently is both consistent and documented. It doesn't change the fact that it's still a scalar and it was typed as a scalar at compile time and it will never change what it is. Static and strong typing.
Another reply is "But when you do @foo + $bar, @foo gets converted to a scalar." Well, yes, that's what it looks like. But, + is defined differently for @foo than it is for $bar. It's not conversion - it's polymorphism. :-)
|
|---|