title: Perl: use of uninitialized variable in nested foreach
body: <p>Trying to check an array of strings against an array of regex 's.</p>
  
  <p>Throws:</p>
  
  <p>'Use of uninitialized value in $string in pattern match (m//) at myscript line '</p>
  
  <p>If I take out the if statement, it still gives warning but prints each
  element in the @string_list</p>
  
  <pre><code>foreach my $expr (@expr_list) {
     foreach my $string (@string_list) {
       if ($string =~ $expr) {
          print $string,"\n"
       }
     }
   }
  </code></pre>