use strict; use warnings; use Test::More tests => 2; ok ("bar foo" =~ /foo/, 'Foo matched at end'); ok ("bar foo" !~ /foo./, 'Foo not matched at end');