http://www.perlmonks.org?node_id=1199355


in reply to caller() returns wrong line on multi-line function call

Which is "the line where the function call actually happens"? Is it the line containing the function name, or the line containing the closing ), or the line half way between, or some other line? You could make up pretty good stories for almost any of those lines, but I can't see any being The One True Line.

In the most common context where it's likely to be interesting - debugging the code, any of the lines should be sufficient so long as indentation doesn't disguise the fact that the call spans multiple lines. Have you a context where one of the lines is more important for some reason? If so, tell us about that and maybe we can help solve the problem of determining the one true line from the dross for you.

Premature optimization is the root of all job security