my $string = <## my @lines = $string =~ m/^(.*?)$/msg; # I need this test to pass is(scalar(@lines), 3, 'found 3 lines only');