in reply to Matching elements inside two array
There are multiple things wrong here.
Your code should always start with:
Your code should always start with:
In general, an if within an if is wrong. This idea should be expressed if (X AND Y). That eliminates an indentation level and makes the code more clear. I have no idea what you are trying to do here..use warnings; use strict;
Update: You ask "I have three arrays such as below. What I want to do is if the element inside the arrays match, then it will do something."if (grep { @input_B eq $_ } @input_array) { if (grep { @input_A eq $_ } @input_array) { foreach my $inputKey (@input_array)
Please explain what a "match" between these 3 array's means? I could not deduce that algorithm from your post.
|
---|
In Section
Seekers of Perl Wisdom