#!/usr/bin/perl -w use strict; my $str1 = "Hi("; my $str2 = "hi"; if ($str2 =~ /\Q$str1\E/) #\Q...\E means like qr #don't interpret characters #like '(' within $str1 #use them verbatim { print "Match: Yes\n"; } else { print "Match: No\n"; } #prints Match: No $str2 = "hI("; if ($str2 =~ /\Q$str1\E/i) #/i means case insensitive { print "Match: Yes\n"; } else { print "Match: No\n"; } #prints Match: Yes