if( grep { $my->{long}{to}{type}{variable}[0] eq $_ } ( 'val1','val2','val3' ) ) { #do something... }