Help for this page

Select Code to Download


  1. or download this
    sub mock {
        my $thing = shift;
    ...
        *One::foo = sub { $closure_self->{x} = 'x'; return "baz\n"; };
        return $self;
    }
    
  2. or download this
    foo
    baz
    destroying...
    foo
    
  3. or download this
    print One::foo();
    {
    ...
        print One::foo();
    }
    print One::foo();
    
  4. or download this
    foo
    Use of uninitialized value in subroutine dereference at script.pl line
    + 31.
    ...
    baz
    baz
        (in cleanup) Unable to create sub named "" at script.pl line 31.