for (ref $entry){ ## i think this will check for the type being input by the user when ('fruitdb::name') { $collection = $FRUIT_NAMES; $criteria->(name) = $entry->{data}{name};