Help for this page

Select Code to Download


  1. or download this
    {
       my $foo = {}; # ref count 1
    ...
    # it refers to it self, its self-referential,  a circular reference
    # for memory held by $foo to be released after $foo goes out of scope
    # $foo->{foo} has to be weakened, the reference count decreased
    
  2. or download this
    sub once {
      my ($self, $name, $cb) = @_;
    ...
    
      return $wrapper;
    }