Help for this page

Select Code to Download


  1. or download this
    $self->{m}->($self,@args);
  2. or download this
    package foo;
    # dispatch table
    my %m_implementation_for;
    ...
        my $implementation = $m_implementation_for{$self};
        $implementation->($self, @args);
    }
    
  3. or download this
    sub m {
        my ($self, @args) = @_;
        $m_implementation_for{$self}($self, @args);
    }
    
  4. or download this
    my %m_closure_for;
    
    # after the implementations have been defined
    ...
        my ($self, @args) = @_;
        $m_closure_for{$self}(@args);
    }