my $resultsRef = search_database($dbName,@toy); foreach my $result (@$resultsRef) { ... }