-1

Trying to check an array of strings against an array of regex 's.

Throws:

'Use of uninitialized value in $string in pattern match (m//) at myscript line '

If I take out the if statement, it still gives warning but prints each element in the @string_list

foreach my $expr (@expr_list) {
   foreach my $string (@string_list) {
     if ($string =~ $expr) {
        print $string,"\n"
     }
   }
 }
craybobnee
  • 103
  • 1
  • 8

1 Answers1

2

That means one of the elements of @string_list is undef.

ikegami
  • 367,544
  • 15
  • 269
  • 518