#!/usr/local/bin/perl -w use strict; my @array = ("P0","P1","P2"); my %completeNOA = ("Al",2,"vi",2); for(0..$#array){ open (NOA, ">","$array[$_].NOA") or die "Couldn't open $array[$_].NOA for writing: $!\n"; print NOA $array[$_]."\n"; # Ueberschrift printf NOA "%s\t=\t%.3f\n",$_, $completeNOA{$_} for keys %completeNOA; # Hash close(NOA); }