Help for this page

Select Code to Download


  1. or download this
    # an object is simply a closure with a hash of closures
    sub make_object {
    ...
                $msg{$m}->(@_) : print "unknown message\n";
        }
    }
    
  2. or download this
    # build an object
    my $object = make_object();
    ...
    &$object("get-self")->("add-msg", "test", sub {print "test ok!\n"});
    &$object("test"); # ==> display "test ok!"