#!/usr/bin/env perl use 5.012; use warnings; my $fix = 'abcdefg'; my $new = 'abcdgrf'; say(($fix ^ $new) =~ tr/\0//c);