467,109 Members | 1,354 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,109 developers. It's quick & easy.

pick out common items from two arrays in a single statement

I have two arrays,i want to take out common elements from
those two arrays in a single statement,

for example ;
two arrays are
my @a = (1, 3 ,4 ,7 );
my @b = (2 , 3 ,6 , 7);

i want to retrieve common elements that are 3 and 7 in a single
Sep 13 '08 #1
  • viewed: 3544
2 Replies
Expert Mod 2GB
Then you are going to have to cycle through each array, comparing the elements to see if each is contained in the other.

Why not try coding that and post your code here, in code tags, if you have issues.


Sep 13 '08 #2
Expert 512MB
Have a look at perlfaq4 for starters.

Sep 13 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by M. Katz | last post: by
6 posts views Thread by a-ok@consultant.com | last post: by
12 posts views Thread by Donnal Walter | last post: by
35 posts views Thread by Troll | last post: by
33 posts views Thread by Peter Seaman | last post: by
6 posts views Thread by Peter | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.