in reply to How to determine current line executing in Script

You can use __LINE__. See "Special literals" in perldata.