in reply to Implementing a text filter on some dataset
Maybe it would be worth writing piece of code converting this filter into something more perlish like this?:
( ( ($hash{AUTHOR} eq 'John' and $hash{PROFIT} eq '90%') or ($hash{AUTHOR} eq 'Matt' and $hash{PROFIT} eq '80%') ) and $hash{PUBLISHER} eq 'OReilly' )
Then your filter is just a Perl condition, which you can apply to your input data stored in %hash like this:
%hash=( AUTHOR=> 'John', PROFIT=> '20%', PUBLISHER=> 'TMH', BOOK=> 'OPERATING SYSTEMS' )
BTW. It is not good, that two conditions (AUTHOR=John PROFIT=90%) are separated by space, should be separated with (AND ...).
|
|---|