kaushik9918 has asked for the wisdom of the Perl Monks concerning the following question:
I need to check if the elements inside both the arrays are present in each of the arrays. That is, I should be able to print out the exclusive elements in both the arrays. My problem is , I am getting stuck at elements which have * in the array#1. for example in the case above, alask* should match to alask<1> and alask<2> . How do I do this with a short code? any ideas? For the above two arrays, my result expected should be a print:array#1 : sdjd dsjd ldlsd epw alask* djsdj array#2 : djsdj ldlsd epw alask<1> ghg alask<2>
thankssdjd dsjd in array#1 not present in array#2 ghg in array#2 not present in array#1 alask* in #array1 matched to alask<1> alask<2> in #array2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Compare two arrays
by Discipulus (Canon) on Dec 05, 2014 at 08:42 UTC | |
by kaushik9918 (Sexton) on Dec 05, 2014 at 09:10 UTC | |
|
Re: Compare two arrays
by hdb (Monsignor) on Dec 05, 2014 at 10:12 UTC | |
by kaushik9918 (Sexton) on Dec 05, 2014 at 14:39 UTC | |
|
Re: Compare two arrays
by hippo (Archbishop) on Dec 05, 2014 at 09:12 UTC | |
by Laurent_R (Canon) on Dec 05, 2014 at 09:28 UTC | |
|
Re: Compare two arrays
by Anonymous Monk on Dec 05, 2014 at 07:36 UTC | |
by kaushik9918 (Sexton) on Dec 05, 2014 at 08:05 UTC | |
by parv (Parson) on Dec 05, 2014 at 08:11 UTC |