I was suggested by experts to post runnable codes to seek advice. Unfortunately, after 4-day trial, I'm unable to break down the large codes written by others to a smaller one. And as what xhoster inferred exactly, the matching string comes from a data file and therefore cannot be known in advance.
It is a cyclic problem that if I had known which line of the perl codes that makes regex fail, I might have already solved half of the problem. But I'm really saying the truth that no line number printed. And there's a single line of error saying "Invalid [] range "l-c" in regex; marked by <-- HERE in m/^3-oxoacyl-[acyl-c <-- HERE arrier protein] reductase fabg1$/"
Xho suggested 2 solutions. One is index instead of regex that I still don't know what it means. Another one is to upgrade perl, which is impossible.
In fact, since input data file is needed and "oxoacyl" does exist in that data file confirmed by search, I believe the fetch program first grabs all the keywords and later uses the variable one by one to match.
I appreciate your comments/critics what can be done to maximize the chance to solve this problem.