Thread hash einer funktion übergeben (23 answers)
Opened by mr-sansibar at 2006-06-16 14:08

mr-sansibar
 2006-06-21 18:27
#8060 #8060
User since
2006-04-13
90 Artikel
BenutzerIn
[default_avatar]
danke das ihr mir soviel ratschläge gibt, aber irgendwie komme ich nicht weiter.

kann mal zeigen was ich bis jetzt geschrieben habe:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
my $write_file = "c:/trxlogfile.txt";

my $fh = new IO::File;
if ($fh->open("> $write_file")) {


#open(OUT, ">$write_file" ) || die "Kann die Datei nicht erzeugen: $!";

my @array_result;
my $string_result;
my %hash;

foreach (@ARGV) {

$string_result=work_with_file($_, $fh, \%hash);
push(@array_result, $string_result);

}

foreach my $key (sort keys %hash) {
print $fh "$key:\n$hash{$key}\n\n";
}


#my $laenge = @ARGV;


for my $i (0..$#ARGV){
print $fh "$ARGV[i]\n\n $array_result[i]\n";
}
}


$fh->close;


bekomme diese fehlermeldung:
Argument "i" isn't numeric in array element at C:\trxLogParser_2006-06-14.pl l
Bareword "i" not allowed while "strict subs" in use at C:\trxLogParser_2006-06
Execution of C:\trxLogParser_2006-06-14.pl aborted due to compilation errors.\n\n

<!--EDIT|mr-sansibar|1150900095-->

View full thread hash einer funktion übergeben