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 was writing a script to generate a Perl module full of regexes, and I wanted to include in the output any comments in the script adjacent to each function call to generate a regex in the output... I ended up going a different way because I decided that solution was too Clever.

  • 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 RonW (Parson) on Sep 15, 2017 at 19:01 UTC
    I wanted to include in the output any comments in the script adjacent to each function call to generate a regex in the output

    Seems a reasonable thing to me.

    My approach would be to change the script so those comments are string literal instead of actual comments. Then the text is readily available to your generator script to include in the generated module.