<?xml version="1.0" encoding="windows-1252"?>
<node id="870806" title="Store regular expressions in a file." created="2010-11-11 05:27:01" updated="2010-11-11 05:27:01">
<type id="115">
perlquestion</type>
<author id="237692">
yoda54</author>
<data>
<field name="doctext">
Monks,&lt;p&gt;

I'd like to read a bunch of regular expressions from a flat text for use in a script.  After I read the file, how do I tell Perl thats this 'data' is a regular expression?

&lt;p&gt;I'd like to accomplish something like the following.

&lt;code&gt;

#!/usr/bin/perl

use strict;
use warnings;

my $data = "duck";
while(&lt;DATA&gt;) {
   if ($data =~ $_) {
      print "$data\n";
   }   
}

__DATA__
s/duck/luck/qr
&lt;/code&gt;</field>
</data>
</node>
