[Bioperl-l] Very basic Perl/BioPerl Help

Stefan Kirov skirov at utk.edu
Thu Apr 14 15:53:32 EDT 2005

It is safer, but I don't think this is highly likely. I usually do 
/\b$accn\b/, which should be sufficient. Anyway it was an example that 
can be used as a start point..

Terry Jones wrote:

>| foreach my $accn (@accn1) {
>| push @unique1,$accn unless (grep(/$accn/, at accn2));
>| }
>Just one more comment on this. You'd be safer doing
>foreach my $accn (@accn1) {
>  push @unique1,$accn unless (grep(/^\Q$accn\E$/, at accn2));
>To guard against false substring matches (with the ^ and $) and
>against the chance that $accn contains a special regexp character (via
>\Q and \E).
>Sorry if this sounds picky... I'm just trying to help a little. Things
>like this can be a pain to track down when/if they finally bite.

More information about the Bioperl-l mailing list