- or download this
@molecules = <MOL>;
map { chomp; $_ = quotemeta; } @molecules;
- or download this
push my @molecules, quotemeta chomp while <MOL>;
- or download this
$bigRegex = join '|', @molecules;
- or download this
my $bigRegex;
($bigRegex .= join( '|', '\b'. $_ . '\b' ) ) for @molecules;
- or download this
my $bigRegex;
$bigRegex = join '|', map { "\b$_\b" } sort { length $b <=> length $a
+} @molecules;
- or download this
#!/usr/bin/perl -w
use strict;
...
print if( scalar( split /\t/ ) >= 6
&& /^([^\t]*\t)?($bigRegex)/ );
}