#! /usr/bin/perl my $test = "abc"; my $test1 = "AbC"; if($test =~ m#$test1#i){ print "\n Both are Same"; } else{ print "\n Both are not Same"; }