BillKSmith has asked for the wisdom of the Perl Monks concerning the following question:
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];
RESULT
not ok 1 # Failed test at tryit2.pl line 10 # got: undef # expected: 'second' # Looks like you failed 1 test of 1.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Failed match not stored
by jwkrahn (Abbot) on Apr 07, 2025 at 20:29 UTC | |
by BillKSmith (Monsignor) on Apr 08, 2025 at 13:42 UTC | |
Re: Failed match not stored
by duelafn (Parson) on Apr 08, 2025 at 00:09 UTC | |
by BillKSmith (Monsignor) on Apr 08, 2025 at 13:55 UTC |