Re: [Boston.pm] Changing line number reported by errors
Uri Guttman <uri-X/[email protected]> Fri, 25 Oct 2019 23:06:32 -0400
| Newsgroups | gmane.comp.lang.perl.perl-mongers.boston |
|---|---|
| Organization | Perl Hunter |
| Message-ID | <[email protected]> |
On 10/25/19 9:17 PM, Greg London wrote: > ahh... #line that's it! > > > $. wouldn't work for me becuase the filehandle is long since > closed by the time I do the eval(), so it will come back 0 > > I'll have to prepend #line to the eval string > and figure out the line number to put there, > but that'll make these scripts I'm dealing with a whole lot > easier to use. that doesn't make sense to me. i think you need __LINE__ . #line will set the line number to whatever you want. if you insert more lines before the eval, then it will be off. __LINE__ is correctly set to the current line number by the compiler. uri