http://www.perlmonks.org?node_id=757207


in reply to Error ... at (eval 75) line 7974.

You might try explicitly setting a more meaningful line number and name via the #line directive (similar to what many incarnations of cpp grok):

my $line = 99; for my $n ( qw/foo bar baz/ ) { my $code = <<"EOT"; #line $line "$n" die "aieee!" EOT eval $code; if( $@ ) { print "Died: $@\n"; } } __END__ Died: aieee! at foo line 99. Died: aieee! at bar line 99. Died: aieee! at baz line 99.

See Plain Old Comments (Not!) in perlsyn for more details.

The cake is a lie.
The cake is a lie.
The cake is a lie.