Back To Schedule
Monday, June 17 • 2:50pm - 3:40pm
Interfaces in Perl5

Sign up or log in to save this to your schedule, view media, leave feedback and see who's attending!

Feedback form is now closed.
Have you ever experienced the software becoming bigger and less maintenance?
In such a case, I think it is important to divide the code, make it easy to change, and make code easier to read.

For that reason, I thought the Interface was useful, and I made a module called Function::Interface.

Function::Interface checks the arguments and return type of the function at compile time.
For example, you can write like this:

package IFoo {
    use Function::Interface;
    use Types::Standard -types;
    fun hello(Str $msg) :Return(Str);

package Foo {
    use Function::Interface::Impl qw(IFoo);
    use Types::Standard -types;

    fun hello(Str $msg) :Return(Str) {
        return "Hello! Pittsburgh! $msg"

It's strange but interesting!

Talk Topics
  • What is Interface, its importance
  • How can I create Interface in Perl?
    • Role is not Interface
  • DEMO Function::Interface
  • Inside Function::Interface
    • Function::Parameters, Function::Return
    • Keyword::Simple, PPR

avatar for Kenta Kobayashi

Kenta Kobayashi

Mobile Factory
I'm organizing [Gotanda.pm](http://gotanda.pm/) and YAPC::Japan.

Monday June 17, 2019 2:50pm - 3:40pm EDT
f) Keystone Suite