use Test::More tests=>1; my @arry1 = (('string' =~ m/str/ or 0), 'second'); my @arry2 = (('string' =~ m/foo/ or 0), 'second'); is $arry2[1], $arry1[1];