use strict; use warnings; use 5.016; my $str = 'hello'; if ($str =~ 'he') { say 'yes'; } --output:-- yes