use Test::More tests=>1; my @arry1 = (scalar 'string' =~ m/str/, 'second'); my @arry2 = (scalar 'string' =~ m/foo/, 'second'); is $arry2[1], $arry1[1]; #### 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];