It would be nice to tell us what you expect your code to do, and in which respect it does not do that.
A couple of comments on your code. It has already been pointed out that the $i3 variable is not used in your loop, which seems to be a possible error (but we do not know since we don't really know what you are trying to do). Having said that, that loop would be more perlish this way:
Similarly, the other loop:for my $i3 (1..9) { # ...
The important thing above is not so much the different syntax, but the fact that this code declares the $i3 and $i variables with the my operator and gives them a lexical scope. All your variables should be declared and you should always use the following pragmas:for my $i (0..$#textarray) { # ...
near the top of your program. They will help you finding errors or deprecated/dangerous constructs. Update: fixed a missing closing parenthesis in one of my loop examples. Thanks to AnomalousMonk for pointing out the typo through the chatterbox.use strict; use warnings;
In reply to Re: looping in 2d array
by Laurent_R
in thread looping in 2d array
by Linguist
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |