in reply to Logical expressions

Here's a bass-ackwards way to do it ... use SQL::Statement which supports logical statements of the kind you show. You can either use it directly and come out with a nested structure of conditions, or you can use one of the DBDs it supports (e.g. DBD::CSV ) which would allow you to treat a single string or single array or an array of arrays or an array of hashes as a temporary table and run queries against it. Alternatively you could rip out the code that does the parsing/evaluation and modify it to suit your needs.