develooper Front page | perl.perl5.porters | Postings from October 2003

Re: Setting the Compiled Name by Hand

Thread Previous
From:
Slaven Rezic
Date:
October 2, 2003 03:58
Subject:
Re: Setting the Compiled Name by Hand
Message ID:
1065092033.3115@devpc01.iconmobile.de
"Martyn J. Pearce" <fluffy@sixears.co.uk> wrote:
> On Thu, Oct 02, 2003 at 09:32:53AM +0000, Slaven Rezic wrote:
> > Try to set the $DB::sub variable:
> > 
> >     my $sub = sub {
> >         $DB::sub = "namedsub";
> >         ...
> >     };
> 
> Thanks for the idea, but that seems not to affect either the use of the
> debugger or dprofpp :-(
> 

No?

$ cat bla.pl
my $sub = sub {
    $DB::sub = "namedsub";
    1;
    1;
    1;
    1;
};

$sub->();
__END__

$ perl5.8.1 -d bla.pl 

Loading DB routines from perl5db.pl version 1.22
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(bla.pl:7):       };
  DB<1> t
Trace = on
  DB<1> c
main::(bla.pl:9):       $sub->();
main::(bla.pl:10):      __END__
main::CODE(0x8139504)(bla.pl:2):            $DB::sub = "namedsub";
main::namedsub(bla.pl:3):           1;
main::namedsub(bla.pl:4):           1;
main::namedsub(bla.pl:5):           1;
main::namedsub(bla.pl:6):           1;
Debugged program terminated.  Use q to quit or R to restart,
  use O inhibit_exit to avoid stopping after program termination,
  h q, h R or h O to get additional info.  
  DB<1> 

Regards,
     Slaven

-- 
Slaven Rezic - slaven <at> rezic <dot> de

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About