#!/usr/bin/perl use strict; # https://www.perlmonks.org/?node_id=11155923 use warnings; use feature 'bitwise'; my $str1='LFGSLSIIVAHHM'; my $str2='LFGSLSIIVSHHM'; print +($str1 ^. $str2) =~ tr/\0//, " characters are the same\n"; #### 12 characters are the same