Changeset 7 in mp3-find for trunk/lib/MP3/Find


Ignore:
Timestamp:
02/01/06 03:05:59 (19 years ago)
Author:
peter
Message:

remove undefined query keys so we don't get warnings when trying to match against 'undef'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/MP3/Find/Base.pm

    r2 r7  
    4242     
    4343    foreach (keys %QUERY) { 
    44         # so we don't have spurious warnings when trying to match against undef 
    45         delete $QUERY{$_} unless defined $QUERY{$_}; 
    46         # package everything uniformly, so subclasses don't need to unpack it 
    47         $QUERY{$_} = [ $QUERY{$_} ] unless ref $QUERY{$_} eq 'ARRAY'; 
     44        if (defined $QUERY{$_}) { 
     45            # package everything uniformly, so subclasses don't need to unpack it 
     46            $QUERY{$_} = [ $QUERY{$_} ] unless ref $QUERY{$_} eq 'ARRAY'; 
     47        } else { 
     48            # so we don't have spurious warnings when trying to match against undef         
     49            delete $QUERY{$_}; 
     50        } 
    4851    } 
    4952     
Note: See TracChangeset for help on using the changeset viewer.