Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE */ at gn gxsmig_mapextver0.1.pl #### if ($line2 =~ /\Q$mappingfield\E/) { ...