Hi All,
 
I want to search whether specific value/data is there are not in Array.
For example lets say i have array as follows.
 
@test = (1,2,3,4,5);
$rel1=4;
 
I need to check whether 4 is there or not. I have one method as follows.
 
if (grep /^$rel1$/, @test)
{
     print "Result = $rel1\n";
} 
 
but i think this is not the proper way because if i use grep then it
would be a platform dependant.
 
Any proper/recommended way.
 
Regards
Irfan.
 
 
 
 

Reply via email to