Help for this page
my %match = map { $_ => 1 } qw(GCGAT CACGT); ... s/N//; # remove the first N in the string print "match: $line" if $match{substr($_, 0, 5)} }
my $pattern = join('|', qw(GCGAT CACGT)); $pattern = qr/^(?:$pattern)/; ... s/N//; # remove the first N in the string print "match: $line" if $_ =~ $pattern; }