As I'm working in perl, I keep trying to build things that do that. I'm dumb enough to build a class and forget to override that one rarely called but vital method. So, I like things that yell at me during compile time

Well, it won't yell at you during compile time, but I wrote Class::Interfaces for just this thing. However, a couple of things to note about Java-style interfaces in Perl.

(1) - Some people here will tell you that Perl is strongly typed because it has Scalars, Arrays and Hashes which are themselves strongly typed. However, they also perform a number of automatic conversions (calling a list in scalar context) which can (at times) defeat the stong typing. And most relevant to this topic, Perl does not strongly type objects.

-stvn

In reply to Re: Java Style Interface Objects? by stvn
in thread Java Style Interface Objects? by pileofrogs

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.