in reply to Matching arbitrary keys across arrays
You potentially have some issues because you are relying on synchronized arrays - these can result in headaches when one array is updated but another is not. But proselytizing aside, if you'd like to scan through what I am assuming is your structure, you can do so with a pair of nested for loops, like
foreach my $i (0 .. $#txtoken) { foreach my $j (0 .. $#{txtoken[$i]}) { if ($txtoken[$i][$j] eq "temeli" and $pstoken[$i][$j] eq "n") +{ print "$tx[$i]\n" ; } } }
Note I've used a string-comparison operator eq to check for string equivalence: eq, == and = mean different things.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Matching arbitrary keys across arrays
by markhh (Novice) on Dec 09, 2010 at 20:58 UTC |