in reply to Search an array for values sequentially
my %score = ( WPA => 1, WPA2 => 2, WEP64 => 3, # ... ); [download]
Than, just search for the maximum. You might need a reversed hash to retrieve the type back from the maximum.