regex - Perl: use of uninitialized variable in nested foreach -


trying check array of strings against array of regex 's.

throws:

'use of uninitialized value in $string in pattern match (m//) @ myscript line '

if take out if statement, still gives warning prints each element in @string_list

foreach $expr (@expr_list) {    foreach $string (@string_list) {      if ($string =~ $expr) {         print $string,"\n"      }    }  } 

that means 1 of elements of @string_list undef.


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -