1. We need to read regular expression statements from a file. 2. The statements get read in from a file into a string and then need to be evaluated.
No need for eval for that. s/$pattern_from_file/.../ works fine on its own.
I could see you using eval is you had the following code pattern and you wanted $r to interpolate captures in $s (e.g. $1):
my $s = '...'; my $r = '...'; s/$s/$r/
In other words, if you wanted $r to be a template. The problem is that eval makes a very poor template system.
In reply to Re^3: Eval Function Question
by ikegami
in thread Eval Function Question
by brwarn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |