In perl, there isn't an "interface" keyword.

The "interface" keyword in Java provides a way for the compiler to check that a certain class implements the set of methods that make up this interface. The Perl compiler does not do this for you, so you cannot declare an "interface" to the compiler. You can, however, declare it to the programmer, for example in a POD.

A good example of many independent implementations of such an interface are the low-calorie drop-in replacements for CGI.pm, or Apache::Request which emulates CGI.pm for use under mod_perl. Note that none of these implementations provides the whole interface of CGI.pm (they are, in fact, making a point of not doing so), that the Perl compiler cannot warn you about this, and that things work anyway (if you read their POD).


In reply to Re: Separation of interface and implementation by Thilosophy
in thread Separation of interface and implementation by johnnywang

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.