I want my output as:array1 array2 read book eat apple book novel apple banana play football tennis football novel mazagine
i tried implementing it with simple for loops as:Hi all, I am trying to implement a co-relation problem in perl. I have two ar +rays i.e. array1 and array2 which contain following values. <c> array1 array2 array3 array4 read book novel magazine eat apple banana play football tennis
But its not showing the proper output. It shows some random output in array3 and array4. Please guide me. Thanking you,for($i=0;$i<$arraylength;$i++) { for($j=0;$j<$arraylength;$j++) { if($array2[$i]== $array1[$j]) { $array3[$i] = $array2[$j]; } } } for($i=0;$i<$arraylength;$i++) { for($j=1;$j<$arraylength;$j++) { if($array2[$i]== $array2[$j]) { $array3[$i] = $array1[$j]; } } } for($i=0;$i<$arraylength;$i++) { for($j=0;$j<$arraylength;$j++) { if($array2[$i]== $array1[$j]) { $array4[$i] = $array3[$j]; } } }
In reply to compare 2 arrays of strings and form a table by sharan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |