I'm trying to match a simple string against a regular expression pattern using the smartmatch operator:
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use open qw(:std :utf8);
my $name = qr{/(\w+)/};
my $line = 'string';
print "ok\n" if $line ~~ /$name/;
I expect this to print "ok", but it doesn't. Why not?