Oh well, not putting __FILE__ in the directive won't work there, my bad :).
Could you eval your generated code instead? You do get the original filename back when you exit the eval scope:
#line 10 Foo warn; eval <<"BAZ"; #line 100 Bar warn; BAZ warn;
Warning: something's wrong at Foo line 10. Warning: something's wrong at Bar line 100. Warning: something's wrong at Foo line 15.
In reply to Re^3: Reset the effect of #line
by Eily
in thread Reset the effect of #line
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |