in reply to Module for Conditional Parsing
I'd like to be able to pass a subroutine a conditional test and a value to test against it. For example the conditional could be a hash ...
Just a thought in case you do go ahead and implement this yourself: Implementing a query language means grammar design + parser + interpreter + tests for everything... why not write the conditionals in Perl?
my $conditional_test = sub { my $value = shift; return $value==10022 || $value==96813 || $value==55401; }; if( $conditional_test->($redis_handle->get('key')) ) { # do something }
Plenty of examples of this: sort, File::Find, ... MJD's Higher-Order Perl is an excellent read in this respect.
|
|---|