http://www.perlmonks.org?node_id=930493


in reply to Find odd/even elements of array

Why not get the database to do it with a table join?

Then you'd only need one query ;)