in reply to Re: Regex stored in a scalar
in thread Regex stored in a scalar

Since my original reply, I have discovered that my concept of "build the command and evaluate it" can be generalized to meet your original requirement.
use strict; use warnings; my $regex=<STDIN>; #Entering s/\),\(/\)\n\(/gi chomp $regex; open (INPUTFILE, "< $filein"); while (<INPUTFILE>) { my $line=$_; #$line =~ $regex; eval "\$line =~ $regex"; };
Bill