in reply to Re^2: variable based #line directives?
in thread variable based #line directives?

i got 'bad file descriptor', which i don't understand
eval returns the value of the last evaluated expression. In your case, there is no expression, so eval returns undef, which triggers die. Use something like
eval qq{#line $l $ld\n1;} or die "$!";
$@ is more common (and meaningful) after eval than $! (see perlvar).