in reply to Test:: to match multiple lines against corresponding regular expressions

Tests are just functions, so you can call them in a loop (the subtest is optional):

use warnings; use strict; use Test::More; my @regexen = ( qr/foo/, qr/bar/, qr/quz/, qr/baz/ ); my @lines = ( "foo!", "Bar!", "Quz!", "baz!" ); subtest "lines match" => sub { plan tests=>@regexen+1; is @lines, @regexen, "count"; like $lines[$_], $regexen[$_], "line ".($_+1) for 0..$#regexen; }; done_testing; __END__ # Subtest: lines match 1..5 ok 1 - count ok 2 - line 1 not ok 3 - line 2 # Failed test 'line 2' # at x.pl line 11. # 'Bar!' # doesn't match '(?^:bar)' not ok 4 - line 3 # Failed test 'line 3' # at x.pl line 11. # 'Quz!' # doesn't match '(?^:quz)' ok 5 - line 4 # Looks like you failed 2 tests of 5. not ok 1 - lines match # Failed test 'lines match' # at x.pl line 12. 1..1 # Looks like you failed 1 test of 1.

Update: Added another test case and the subtest.