in reply to Perl etiquette - eval

From what you say, it seems the script you're tring to amend is a mess - likely made of unreadable patches, one after the other. At this point, what I would do is to infer the main control flow of the script to understand what's going on. In the case you know you have a performance problem, I'd instrument it in order to obtain an execution profile.

In a scenario like this, where you know you are going to modify soething you don't completely understand, it's a good idea to create a regression test suite so you know you won't be breaking something when you amend it. And if you do that while you're studying it, you will discover it won't tke so much time after all.

In any case, be sure not to optimize before 1) profiling and, 2) understanding what the script does.