From: martinahansen Date: Wed, 16 Dec 2009 12:20:05 +0000 (+0000) Subject: fixed bug in grab X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8a47bed7f528b606ae2302c41bf1c28917a73ea5;p=biopieces.git fixed bug in grab git-svn-id: http://biopieces.googlecode.com/svn/trunk@823 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/bp_bin/grab b/bp_bin/grab index 8728f81..95b82c8 100755 --- a/bp_bin/grab +++ b/bp_bin/grab @@ -28,6 +28,7 @@ use warnings; use strict; +use Data::Dumper; use Maasha::Biopieces; use Maasha::Common; use Maasha::Patscan; @@ -181,13 +182,17 @@ sub grab_patterns # Returns boolean. - my ( $pattern ); + my ( $pattern, $key ); foreach $pattern ( @{ $patterns } ) { if ( $keys ) { - map { return 1 if index( $record->{ $_ }, $pattern ) >= 0 } @{ $keys }; + foreach $key ( @{ $keys } ) + { + return 0 if not exists $record->{ $key }; + return 1 if index( $record->{ $key }, $pattern ) >= 0; + } } else {