diotalevi has asked for the wisdom of the Perl Monks concerning the following question:
I'm writing a small debugger for myself to generate Test::MockObject scripts. I'm able to trap method calls and function calls but I don't know how to distinguish between the two. Can any of you help?
BEGIN { $ENV{PERL5DB} = ''; $^P = 0x01; # Debug subroutine enter/exit. } $obj = bless do { \ my $x }, "Deb"; $obj->meth; Deb::func( $obj ); sub Deb::meth { } sub Deb::func { } package DB; sub sub { print "$sub( " . join( ', ', @_ ) . " )\n"; }
Results in:
Deb::meth( Deb=SCALAR(0x97f3c4c) ) Deb::func( Deb=SCALAR(0x97f3c4c) )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Distinguish method/function call during debugger?
by ikegami (Patriarch) on Feb 23, 2006 at 17:12 UTC | |
by diotalevi (Canon) on Feb 23, 2006 at 17:13 UTC | |
by ikegami (Patriarch) on Feb 23, 2006 at 17:17 UTC | |
by diotalevi (Canon) on Feb 23, 2006 at 17:21 UTC | |
by ikegami (Patriarch) on Feb 23, 2006 at 17:59 UTC | |
|
Re: Distinguish method/function call during debugger?
by adrianh (Chancellor) on Feb 24, 2006 at 11:23 UTC | |
by diotalevi (Canon) on Feb 24, 2006 at 19:22 UTC | |
by adrianh (Chancellor) on Feb 27, 2006 at 01:32 UTC |