open(my $in, "<", "Texts.txt") or die "impossible: $!"; #$morph=0; LINE: while (<$in>){ if(/\\tx/){ push (@tx, $_); push @txtoken, [split]; } if(/\\ps/){ push (@ps, $_); push @pstoken, [split]; } } foreach($txtoken[$j][$i] = "temeli" and $pstoken[$j][$i]= "n"){ print "$tx[$j]\n" ; } }