develooper Front page | perl.perl5.porters | Postings from April 2018

[perl #133123] eval '__PACKAGE__' in debug mode do not return rightpackage

Thread Previous | Thread Next
KES via RT
April 23, 2018 08:24
[perl #133123] eval '__PACKAGE__' in debug mode do not return rightpackage
Message ID:
Yes, It is implemented in this way. But to my mind it would be more consistent 
 if __PACKAGE__, __LINE__ would be bound to COP

Thus if we look at N frames up the `p __LINE__` will show user's script line and not debugger's eval.

This is minor, but looks more expected

Also when evaluating at users context, it is eval at first non-DB frame.

Just like: 'eval EXPR, 0'. It would be cool if eval in debugger mode (-d) will accept second argument which means stack frame number from TOP. And evaluates given EXPR at given frame.

This will be not so criminal to support it, because it already support 0 frame. Also this will simplify hacks like this:

via perlbug:  queue: perl5 status: open

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About