in reply to Escaping characters in the array
Better still to just iterate and forget the index unless you actually need it:foreach my $cur_cnt (0..$#current) { foreach my $base_cnt (0..$#base) { if ($base[$base_cnt] =~ /^\Q$current[$cur_cnt]\E/) { # ... } } }
Less is more, especially with programming.foreach my $current (@current) { foreach my $base (@base) { if ($base =~ /^\Q$current\E/) { # ... } } }
|
|---|