in reply to variable compare
#!/usr/bin/perl -l # https://perlmonks.org/?node_id=1218408 use strict; use warnings; my $x = "YAAY"; my $y = "YAAA"; print +(($x ^ $y) =~ tr/\0/\xff/cr & $x) =~ tr/\0//dr; [download]