in reply to lost in eval and regexp

It is not clear to me what you are trying to accomplish since you do not provide any expected output. However, if I run your code using the strictures (use warnings; use strict;), I get many warnings of the variety:
Use of uninitialized value in concatenation (.) or string
If I add print "tmp=$tmp\n"; after your eval statement, I see that $tmp is the culprit. So, I believe your eval statement is not doing what you expect it to do. What do you expect it to do?