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