examples/intro-testing/like.t
#!/usr/bin/perl
use strict;
use warnings;

use Test::More tests => 2;

like( foo(), qr/\d+/, "there are some digits in the result" );
like( bar(), qr/\d+/, "there are some digits in the result" );

sub foo {
    return "This is a long text with a number 42 in it";
}
sub bar {
    return "This is another string with no number in it";
}

perl intro-testing/like.t

1..2
ok 1 - there are some digits in the result
not ok 2 - there are some digits in the result

#   Failed test 'there are some digits in the result'
#   at examples/intro/like.t line 8.
#                   'This is another string with no number in it'
#     doesn't match '(?-xism:\d+)'
# Looks like you failed 1 test of 2.