Re: [Boston.pm] Changing line number reported by errors

Uri Guttman <uri-X/[email protected]> Fri, 25 Oct 2019 12:14:40 -0400
Newsgroups gmane.comp.lang.perl.perl-mongers.boston
Organization Perl Hunter
Message-ID <[email protected]>
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.

uri

_______________________________________________
Boston-pm mailing list
[email protected]
https://mail.pm.org/mailman/listinfo/boston-pm