in reply to Search an array for values sequentially

Score the security types in a hash:
my %score = ( WPA => 1, WPA2 => 2, WEP64 => 3, # ... );

Than, just search for the maximum. You might need a reversed hash to retrieve the type back from the maximum.

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ