foreach my $fact (@facts) { eval { my $result = match({ composer => 'COMPOSER', initials => 'js', lived => 'LIVED' }, $fact); print "The composer with initials 'js'", " is $result->{COMPOSER}", " who lived from $result->{LIVED}[0]", " to $result->{LIVED}[1]\n"; }; }