http://www.perlmonks.org?node_id=1064689


in reply to Substring comparisson problem

Hi ChTidio,

It's because you're looking for the substring "Hello" with the quotes. Get rid of them and try again:

my $string = "Hello World"; if ($string =~ /Hello/) { print "Basic String contains: Hello\n"; }

Update:   You could also put quotes around 'Hello' with any of the following (among other possibilities):

my $string = "\"Hello\" World"; my $string = '"Hello" World'; my $string = q{"Hello" World}; my $string = qq{"Hello" World};

Then your original regex should find the quoted substring "Hello":

if ($string =~ /"Hello"/) { print "Basic String contains: Hello\n"; }
say  substr+lc crypt(qw $i3 SI$),4,5