6 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
#!/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);
}
1
2
3
4
5
6
7
8
9
10
@array = ("Datei1","Datei2","Datei3");
my %Ausgabe = ("Zeile1",2,"Zeile2",2);
for(0..$#array){
open (NOA, ">","$array[$_].NOA")
or die "Couldn't open $array[$_].NOA for writing: $!\n";
print NOA $array[$_]."\n";
printf NOA "%s\t=\t%.3f\n",$_, $Ausgabe{$_} for keys %Ausgabe;
close(NOA);
}
6 Einträge, 1 Seite |