use strict; use warnings; use version '5.38'; use feature 'say'; use Test::More tests=>1; my @arry1 = ('string'=~ m/str/, 'second'); my @arry2 = ('string'=~ m/foo/, 'second'); # no value stored for failed match. is $arry2[1], $arry1[1];