I may be totally wrong, but I always thought that the advantage of static typing had mostly to do with speed and size. For example in the following sub, every time it runs it has to first look up what type of object $thing is and then check to see if that type of object has a "to_xml" method.
sub foo{ my $thing = shift; print $thing->to_xml; }
But in the following (probably bad) C++ code, the function can be looked up just once at compile time, because the function knows what type of object 'thing' will be:
void foo(bar thing){ cout << thing.to_xml(); }
Yet another layer is added when you use overloading. Let's say that a variable is used in a concatenation, perl must first determine what if any class of object that variable belongs to. If the variable does belong to a class it must determine if that class has the concatentation operator overloaded, if it does then in must determine if the subroutine exists that it is overloaded with, and then it calls that subroutine. In a static typed language this only has to be done once at compile time.
The size difference shows most with ints and chars. As I understand it in perl every scalar is a C struct. If a variable is only ever going to be an int, then it is a waste to make a struct for it.
I am not saying that static typing is better, but I think there are some speed and size advantages.

In reply to Re: Static checking by fletcher_the_dog
in thread Static checking by hanenkamp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.