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


in reply to problem with eval

Congratulations, you found a bug in your version of Perl!

Here is how to tell. Try typing:

perldoc perldiag
and then to find your message do:
/panic: top
This will give you the following text:
panic: top_env (P) The compiler attempted to do a goto, or something weird like that.
The description at the top of perldiag says that (P) indicates a trappable internal error that should never arise.

Now if you can narrow down what size it starts running into trouble with, I would suggest using the handy perlbug utility and reporting this as a bug. You probably should not send the offending file (you say it is large) but be willing to send it privately on request.

Other posters are correct in saying that for your problem it is probably better to use a module, do, require, etc rather than an explicit eval. However there are times when an eval is right even so, and it shouldn't randomly break.

Important Note
If you see an explicit error message like this, don't guess. Go straight to the documentation and look for the description of what that message means. If there are a stream of messages, the first one is probably the real error and the rest are consequences, so look up the first one and try to fix that. This advice is good whether you get the message, a co-worker, or it is a random question.