Please advice how to pass 3 variables in an array with relation.
@item = ($a , $b , $c);
@record = push(@array, @item);
I want to assign value in a @array so that if I look for any instance I should get value of all a,b,c.
Is there any way apart from comma to assign a value in array. like $a:$b:$c or $a>$b>$c I need this because i am want to grep 1 record(a) and get (a:b:c)
@array1 = grep(!/$a/, @array);
expected output should be a:b:c
Thanks,
The question is not very clear. Maybe you should rephrase it. However, I understand you want an array with groups of three elements.
You might want to use array references.
or
Also,
push
won't return an array as you expect. Perldoc says:Now if you want to filter these groups of three elements, you can do something like that:
Please note that if you want an exact match you should use the
eq
operator instead of a regex...