@array = ($a, $b, $c, $d);
if((grep{$array[0] == $_}@array[1..$#array]) == $#array){
print 'true';
}

うーん、こっちの方が汎用性あると思うんだけどなあ、
やっぱ駄目ですか?そうですか