Next Hook::LexWrap 13

Dynamic Scope for Wrappers

        { my $temporarily = wrap 'myfunc', ...;
          myfunc(...);     # Wrappers are called here
        }
        myfunc(...);       # ... but not here
        return bless sub{ $unwrap=1 }, 'Hook::LexWrap::Cleanup';
        package Hook::LexWrap::Cleanup;
        sub DESTROY { $_[0]->() }
                if ($unwrap) { goto &$original }



Next Copyright © 2003 M. J. Dominus