foreach my $datamodel (@$datamodels) { my $file = $filenames->{$datamodel}; print "$file\n"; }