I like this one thanks :-)
I'd suggest one little addition:
to allow printing the parameters to the procedure.Line 16: verbose => $arg{verbose} ? '' : "\n", ++ params => $arg{params} ? 1 : 0, Line 31: -- my( $direction, $pkg, $sym ) = @_; ++ my( $direction, $pkg, $sym , $start) = @_; Line 37: -- $pkg, $sym, $self->{verbose}, ++ $pkg, $sym, ++ ( $start && $self->{params} ? "( '".join( "', '", @_[0..$#_-1] +)."')" : ()), ++ $self->{verbose}, Line 85: -- pre => $self->_gen_wrapper( $self->{pre}, $pkg, $sym, ), -- post => $self->_gen_wrapper( $self->{post}, $pkg, $sym, ); ++ pre => $self->_gen_wrapper( $self->{pre}, $pkg, $sym, 1 ), ++ post => $self->_gen_wrapper( $self->{post}, $pkg, $sym, 0 +);
The code doesn't print data structures, if some of the parameters is a reference you'll see just SCALAR(xxxx), but I do not think that much info is needed. If you think otherwise you could use Data::Dumper to print them out:
Line 5: use Hook::LexWrap; ++ use Data::Dumper; Line 31: return sub{ ++ local $Data::Dumper::Indent = 0; ++ local $Data::Dumper::Terse = 1; Line 37: -- $pkg, $sym, $self->{verbose}, ++ $pkg, $sym, ++ ( $start && $self->{params} ? '( '.join( ", ", Dumper(@_[0..$# +_-1])).")" : ()), ++ $self->{verbose},
Jenda
== Jenda@Krynicky.cz == http://Jenda.Krynicky.cz ==
Always code as if the guy who ends up maintaining your code
will be a violent psychopath who knows where you live.
-- Rick Osborne, osborne@gateway.grumman.com
In reply to Re: Devel::TrackSub - Subroutine wrappers for debugging
by Jenda
in thread Devel::TrackSub - Subroutine wrappers for debugging
by particle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |