$perl =~/(?:strongly|weakly|statically|dynamically) typed/;

Ovid on 2004-12-14T19:49:14

Four terms:

  • Strong typing
  • Weak typing
  • Static typing
  • Dynamic typing

I used to think I knew what all of those mean. Now I know I don't. It seems that very few people can agree on the definitions but they're quite happy to argue the merits of them.


strong typing

merlyn on 2004-12-14T20:11:54

I used to believe in strong typing... then my keyboards kept wearing out.

Murky Terms

ziggy on 2004-12-14T20:29:37

All four terms are a bit murky in Perl.
  • Perl is strongly typed, because there is absolutely, positively no way in Hell you can coerce a hashref into a listref or a coderef.
  • Perl is weakly typed, because you really don't care what happens if you use an integer as a string, or a string as an integer. It all just works.
  • Perl is statically typed because the compiler creates $foo as a scalar variable, and it will always remain so. $foo will never be a list, hash or subroutine.
  • Perl is dynamically typed because $foo can hold an integer now, a string later, and a coderef in between.
Confused yet? ;-)

Type types

brian_d_foy on 2004-12-15T06:03:32

Don't forget that Perl is also stereo typed, mis typed, and best of all, my type(d).