if ( !grep { $_ != $a } ($b, $c, $d, $e...) ) { &do_something }