Help for this page

Select Code to Download


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