my $cnt = 0; while (...) {    ...    $hash{$header} = [$cnt, $inhalt];    ++$cnt;    ... } ... for my $key (sort { $hash{$a}[0] <=> $hash{$b}[0] } keys %hash) {    print "$key => $hash{$key}[1]\n"; }