Skip Menu |

This queue is for tickets about the Sub-Quote CPAN distribution.

Report information
The Basics
Id: 122077
Status: open
Priority: 0/
Queue: Sub-Quote

People
Owner: Nobody in particular
Requestors: REHSACK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Improve debugability of quoted subs
Please add a flag (e.g. debug) which causes every string eval is prepended by a "#line ${\(__LINE__+1 . ' ' . __FILE__)}". The originally quoted sub should take it's information from caller().
I've been tempted to add something like this for a long time, but I've avoided doing so because the line numbers will almost inevitably be inaccurate. And a misleading line number in some ways could be worse than the non-answer you get right now.
On Thu Jun 15 07:15:40 2017, haarg wrote: Show quoted text
> I've been tempted to add something like this for a long time, but I've > avoided doing so because the line numbers will almost inevitably be > inaccurate. And a misleading line number in some ways could be worse > than the non-answer you get right now.
Well - if the caller uses the debug flag in inappropriate way, things will go wrong. But holding back a tool because fools can do wrong things with it isn't reasonable, is it? You can be smart and specify basic and advanced API for debug: debug => 1: #line @caller... debug => "\d\s.*": #line $_ debug => {line => ..., file => ...}: #line line . " " . file Cheers