Christiane Nerz wrote: > Hi all! > > I like to read several rows out of two different table-files and put > them successively in a new file by: > > @ergebnis_alles[$#ergebnis_alles+1] = @whole_data1[$l] . $whole_data2[$m]; > > Anything works fine, except that I can't delete the ending newline in > the lines in the first tables. So the data is put in two following lines > and not successively in one line. I tried chmod, but got error-messages. > > Whole part of code is: > foreach $el1 (@strings1) {chomp $el1: $m=0;
> foreach $el2 (@strings2) { #Why were the innards of this if block not indented? chomp $el2 > > if ($el1 eq $el2) > [EMAIL PROTECTED] = $el1; > @ergebnis_alles[$#ergebnis_alles+1] = @whole_data1[$l] . > $whole_data2[$m]; > } > else > {..... > } > $m=$m+1; > } > $l=$l+1; > } > > greetings > Jane The solution above is a bit ugly, because the indentation in your original was so random. Since you have the opening of the loop indented by two spaces, I will assume that two spaces is what you set as your standard indent. foreach $el1 (@strings1) { chomp $el1; $m=0; foreach $el2 (@strings2) { chomp $el2; if ($el1 eq $el2) { @strings3[$#strings3+1] = $el1; @ergebnis_alles[$#ergebnis_alles+1] = @whole_data1[$l] . $whole_data2[$m]; } else { #..... } $m=$m+1; } $l=$l+1; } Actually, 3 or 4 spaces would probably be better as a standard. What is really important though, is that you have some standard. Indentation is not some random decoration of your code. It is an essential tool to keep your code readable and maintainable. You shouldn't have to sdrunch your eyes to know which lines are executed together as a block. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]