Skip Menu |

This queue is for tickets about the Devel-Callsite CPAN distribution.

Report information
The Basics
Id: 89843
Status: resolved
Priority: 0/
Queue: Devel-Callsite

People
Owner: Rocky Bernstein (no email address)
Requestors: perl [...] toby.ink
Cc:
AdminCc:

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



Subject: It would be useful to be able to pass callsite an integer a la caller
To find the callsite of non-immediate callers.
I can't see how that's useful, since the whole idea is to get a unique callsite ID for the call location. Can you give an example? Thanks! Ted
On 2013-11-03T12:01:00Z, TEODOR wrote: Show quoted text
> I can't see how that's useful, since the whole idea is to get a unique > callsite ID for the call location. Can you give an example?
Here's what I'd want to print the same address twice: perl -MDevel::Callsite -le'sub foo { print callsite(1); }; sub bar { foo(); foo(); } bar();' Whereas this, would act the same as the current callsite(): perl -MDevel::Callsite -le'sub foo { print callsite(0); }; sub bar { foo(); foo(); } bar();' I need this because I want to use callsite() from a function which is called through several layers of wrapper subs. In this function I need to print a warning, but if the function is called repeatedly from the same site, I'd like to only warn the first time. I already calculate how many layers of wrapper to eliminate in order to report the right line numbers; I'd like to also pass that number to callsite() in order to find the call site ignoring the wrapper functions.
mauzo on github https://github.com/mauzo submitted a patch for this that has just been merged which I think addresses this problem. Please double check. If things work out, I guess we can put out another release. Lastly, I confess I didn't see this until mauzo had mentioned it. I don't automatically get bug reports from RT, and even if I did I find the mechanism more cumbersome than opening up a github issue: https://github.com/rocky/Perl-Devel-Callsite/issues/new If folks know the best way to let folks know not to use RT in favor of github issues or a way to better link the two, I'd be grateful. On Sun Nov 03 15:42:12 2013, TOBYINK wrote: Show quoted text
> On 2013-11-03T12:01:00Z, TEODOR wrote:
> > I can't see how that's useful, since the whole idea is to get a > > unique > > callsite ID for the call location. Can you give an example?
> > Here's what I'd want to print the same address twice: > > perl -MDevel::Callsite -le'sub foo { print callsite(1); }; sub bar { > foo(); foo(); } bar();' > > Whereas this, would act the same as the current callsite(): > > perl -MDevel::Callsite -le'sub foo { print callsite(0); }; sub bar { > foo(); foo(); } bar();' > > I need this because I want to use callsite() from a function which is > called through several layers of wrapper subs. > > In this function I need to print a warning, but if the function is > called repeatedly from the same site, I'd like to only warn the first > time. I already calculate how many layers of wrapper to eliminate in > order to report the right line numbers; I'd like to also pass that > number to callsite() in order to find the call site ignoring the > wrapper functions.
Since I haven't heard from folks, I'll assume this is fixed. If there needs to be more discussion follow on https://github.com/rocky/Perl-Devel-Callsite/pull/2