Please clarify perldebguts page about value of $DB::sub may have

Hi.

Hi. The perldebguts should be fixed a bit. The documentation says: 

>When execution of the program reaches a subroutine call, a call to &DB::sub (args) is made instead, with $DB::sub holding the name of the called subroutine.

but $DB::sub may contain CODEREF in case when call to sub{ 1; }->() is made

$ cat Devel/DB.pm
package DB;

sub DB{};
sub sub{ print $DB::sub, "\n" };

1;


$ perl -d:DB -e 'sub{ 1 }->()'
CODE(0x10a4178)


as haarg says on IRC that is:
when calling an anonymous or lexical sub, or if the sub is no longer accessible through its name
0
kes
1/10/2018 1:32:43 PM
perl.perl5.porters 47209 articles. 0 followers. Follow

1 Replies
24 Views

Similar Articles

[PageSpeed] 44

Fixed in commit 5109e49ff544d495902386fbfc547a0fc9e35200.

-zefram
0
zefram
1/17/2018 11:10:09 PM
Reply: