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

I would argue that the One True Line—for debugging and other purposes—is the line that contains the function name. That said, if caller() reported some other line (e.g. the line with the open paren or close paren) consistently, then it would be OK, I guess, but the inconsistency seems like a Problem.

  • Comment on Re^2: caller() returns wrong line on multi-line function call

Replies are listed 'Best First'.
Re^3: caller() returns wrong line on multi-line function call
by LanX (Saint) on Sep 14, 2017 at 18:06 UTC
    No need to argue, the one true line is by definition where a statement starts.

    This is for sure a bug and it's not caller's fault.

    Probably also affecting other statements not only function calls.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

      the one true line is by definition where a statement starts.

      How can that possibly be right? By definition you don't have a call until the close bracket for the argument list because you don't have enough information to make the call until then!

      Like I said already, good stories could be made for almost any line. :-)

      Premature optimization is the root of all job security