On Oct 25, 2019, at 12:14 PM, Uri Guttman <[email protected]> wrote:
> On 10/25/19 12:03 PM, Morse, Richard E.,MGH via Boston-pm wrote: >> I haven’t tried this, but according to the documentation for $. >> ($INPUT_LINE_NUMBER), you should be able to assign a value to this which >> Perl will use for reporting: > > another idea: > > __LINE__ is a compiler generated value of the current line. so you could > do something like this: > > print $@, 'error at line: ', __LINE__ ; > > i recall something can be done with # comments to also set a line number > but i can't find it in the docs. the __LINE__ thing should be enough. Maybe I misunderstood — I thought Greg was looking to change the reported line number of the file he read the code from, not the line number of the program running the slurped code. __LINE__ would be the right answer for that, although I don’t know when it was introduced — I have a vague recollection that it’s more recent… Ricky The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail. _______________________________________________ Boston-pm mailing list [email protected] https://mail.pm.org/mailman/listinfo/boston-pm

