People don’t say Perl does type inference because Perl doesn’t do type inference in the technical sense of the term. People have other technical terms for what Perl is doing, e.g. “implicit type conversion”. In your example, Perl does not infer that “3″ belongs to the type of integers, because that is false. First off, Perl doesn’t subdivide scalars into types like integers and strings. Secondly, if it did have separate types for integers and strings, then “3” would belong to the type of strings, which would have a different memory representation than integers. What Perl does is insert a silent conversion operation at runtime, which can sometimes give weird results, e.g. in your example it would happily treat “a” as the integer zero. (Type inference, my ass!) Similarly, there could be a conversion operation from strings like “$150” to values of type Money, but that doesn’t mean you should be talking about “type inference” to say such strings “are” values of type Money.
People bring up type inference when discussing functional programming because Haskell and ML use variants of the Hindley-Milner algorithm. I don’t want to talk about “defining” functional programming, or discuss whether some language should or shouldn’t be labeled “functional”, because such questions are ultimately about words and therefore useless.
People don’t say Perl does type inference because Perl doesn’t do type inference in the technical sense of the term. People have other technical terms for what Perl is doing, e.g. “implicit type conversion”. In your example, Perl does not infer that “3″ belongs to the type of integers, because that is false. First off, Perl doesn’t subdivide scalars into types like integers and strings. Secondly, if it did have separate types for integers and strings, then “3” would belong to the type of strings, which would have a different memory representation than integers. What Perl does is insert a silent conversion operation at runtime, which can sometimes give weird results, e.g. in your example it would happily treat “a” as the integer zero. (Type inference, my ass!) Similarly, there could be a conversion operation from strings like “$150” to values of type Money, but that doesn’t mean you should be talking about “type inference” to say such strings “are” values of type Money.
People bring up type inference when discussing functional programming because Haskell and ML use variants of the Hindley-Milner algorithm. I don’t want to talk about “defining” functional programming, or discuss whether some language should or shouldn’t be labeled “functional”, because such questions are ultimately about words and therefore useless.