[OT] Perl woes
James Laver
james.laver at gmail.com
Wed Jan 28 14:21:45 GMT 2009
On Wed, Jan 28, 2009 at 2:02 PM, Peter Corlett <abuse at cabal.org.uk> wrote:
> Python is dynamic and manages this just fine:
>
> $ python
> Python 2.5.2 (r252:60911, Aug 6 2008, 09:17:29)
> [GCC 4.3.1] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> '1' + '2'
> '12'
>>>> 1 + 2
> 3
>>>> 1 + '2'
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> TypeError: unsupported operand type(s) for +: 'int' and 'str'
That's because python is strongly typed (though not statically typed
-- it's a dynamic language).
I suppose perl is strongly typed as for the difference between
scalars, lists etc., it just doesn't care what's in a scalar (without
discussion of the internals at any rate).
So if we update Nick's statement to reflect that perl's typing system
is weaker, then his point stands perfectly.
Cheers,
--James
More information about the london.pm
mailing list