#6 Subs pane attempts to load anonymous subroutines

open
nobody
None
5
2005-01-06
2005-01-06
Anonymous
No

I'm not sure if this is specific to my configuration (XP,
Perl 5.8.4, ptkdb 1.1091), as I have not seen this on
other configurations (typically Unix, but these were also
older Perls).

When a subroutine level is opened (double clicked) in
the Subs page, ptkdb attempts to load any anonymous
subroutines using the default description returned in
DB::sub. This results in Tk errors, and termination of the
expansion of the level. The error returned is of the form

"error:parent element "<package>.__ANON__
[<pathname>/... does not exist at <Tk path>/Tk.pm line
247"

This is generated in ptkdb::sub_list_cmd (line 1889 in
the above version), specifically the line

$sub_list->add($path . '.' . $_, -text => $h->{$_}->
{'path'}) ;

I've worked around this for now by simply removing any
anonymous routine entries in the tree_split logic, but
there is probably something better than can be done
with these (I won't pretend to have fully decoded this,
so this may open other holes!)

foreach $list_elem ( @$listRef ) {
next if ($list_elem =~ /__ANON__\[/); # << added

Regards

Andrew McLaren (andrew @ mclarenfamily . com)

Discussion