use warnings;
use strict;
+use Data::Dumper;
use Maasha::Biopieces;
use Maasha::Common;
use Maasha::Patscan;
if ( $keys )
{
- map { return 1 if exists $lookup_hash->{ $record->{ $_ } } } @{ $keys };
+ map { return 1 if $record->{ $_ } and exists $lookup_hash->{ $record->{ $_ } } } @{ $keys };
}
else
{
}
if ( not $keys_only ) {
- map { return 1 if exists $lookup_hash->{ $record->{ $_ } } } keys %{ $record };
+ map { return 1 if $record->{ $_ } and exists $lookup_hash->{ $record->{ $_ } } } keys %{ $record };
}
}
# 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
{
if ( $keys )
{
- map { return 1 if $record->{ $_ } =~ /$regex/ } @{ $keys };
+ map { return 1 if exists $record->{ $_ } and $record->{ $_ } =~ /$regex/ } @{ $keys };
}
else
{