#!/usr/bin/perl $var = undef // "defined-or and smartmatch both work"; print "$var\n" if $var ~~ qr{work};