# let array handle context. # list of items in list context, count of items in scalar. sub find_things { my( $storage, $criteria ) = @_; my @things = $storage->lookup( $criteria ); @things } # let grep handle context. # list of items in list context, count of items in scalar. sub matching_things { my( $storage, $pat ) = @_; grep /$pat/, $storage->things() }