To find the elements that are not found in the first array I wrote1. @sorted_original_cellnames 2. @sorted_top_cellnames
Similarly for the second array I wrote@test1{@sorted_original_cellnames} = undef; @not_found_in_original = grep{!exists $test1{$_}}@sorted_top +_cellnames;
This code was working fine as long as we had the same number of elements in both the arrays. Today I have a new situation -> I have 71 items in the first array and only 66 items in the second. The code is not working properly. It generates @not_found_in_originalarray with 5 elements of nothing and the @not_found_in_topcell with 5 elements that are missing. Also the code gives following errors@test2{@sorted_top_cellnames} = undef; @not_found_in_topcell = grep{!exists $test2{$_}}@sorted_orig +inal_cellnames;
I tried rewriting the code with foreach, still I get the same problem, any idea to correct this. Thanks in adavance for all who helps me. AugustineUse of uninitialized value in exists at checkmodlist.pl line 355. Use of uninitialized value in hash slice at checkmodlist.pl line 358.
In reply to Extracting elements in one array but not in another by august3
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |