in reply to prefix notation in an array

Problems like this involve two parts: parsing and syntax-directed translation. So the first step is to create a grammar for your infix expression:
# infix operators: ==, or, and # grouping: () # terminals : \w+ # # term := (expr) # | \w+ # expr := term /and/ term # | term /or/ term # | term /==/ term
Parsing expressions usuing this grammar will generate a parse tree. Then you can walk the parse tree to create the prefix notation. In our case, the grammar is so simple, we can translate as we go along:
# infix operators: ==, or, and # grouping: () # terminals : \w+ # # term := (expr) {print '[' . $expr . ']'} # | \w+ {print $word} # expr := term /and/ term {print 'and,' . $term1 . ',' . $term2} # | term /or/ term {print 'or,' . $term1 . ',' . $term2} # | term /==/ term {print '==,' . $term1 . ',' . $term2}
The bits in {} are called actions and you can take them as soon as you satisfy the given parse rule.

Given the grammar and actions, your task is (you didn't think I would take all the fun out of it, did you?) to create a recursive descent program implementing this grammar. The grammar is simple enough that you could hand-roll your own. Or you could use Parse::RecDescent to automatically generate a program from your grammar (you may have to tweak the grammar to satisfy P::RD's grammar format).

Have fun!

-Mark