like()

Next to is() and ok(), you'll be using like() the most.

like( $this, qr/that/ );

same as:

ok( $this =~ /that/ );

except it has nice diagnostics:

not ok 1
#     Failed test (contrived.t at line 2)
#                   'wibble'
#     doesn't match '(?-xism:woof)'

Because qr// was added in 5.005, it understands a string that looks
like a regex for older perls.

like( $this, '/that/' );

And there is an unlike() which is the !~ version.

| toc |