I am trying to figure out a way of checking for the existence of a value in an array without iterating through the array.
I am reading a file for a parameter. I have a long list of parameters I do not want to deal with. I placed these unwanted parameters in an array @badparams
.
I want to read a new parameter and if it does not exist in @badparams
, process it. If it does exist in @badparams
, go to the next read.
转载于:https://stackoverflow.com/questions/2860226/how-can-i-check-if-a-perl-array-contains-a-particular-value