use Test::More 'tests' => 5; ok( 'foo' =~ //, 'empty regex matches' ); ok( 'foo' =~ /foo/, '/foo/ matches' ); ok( !('bar' =~ //), 'repeated match of foo' ); ok( !('bar' =~ /\Q/), 'repeated match with \\Q' ); my $empty = ''; ok( !('bar' =~ /\Q$empty/), 'interpolated empty string same as \\Q' );