in reply to Re^2: Eval Function Question
in thread Eval Function Question

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.