dideod.yang has asked for the wisdom of the Perl Monks concerning the following question:
use strict; my ($x,$y,@x,@y,$i); # case 1 $x = "YAAY"; $y = "YAAA"; $x =~ s/[$y]+//g; print "$x"; # case 2 $x = "YAAY"; $y = "YAAA"; @x = split(//,$x); @y = split(//,$y); for($i=0;$i<=$#x;$i++){if($x[$i] ne $y[$i]){print "$x[$i]\n"}}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: variable compare
by tybalt89 (Monsignor) on Jul 13, 2018 at 00:35 UTC | |
|
Re: variable compare
by choroba (Cardinal) on Jul 13, 2018 at 06:50 UTC | |
|
Re: variable compare
by AnomalousMonk (Archbishop) on Jul 13, 2018 at 01:38 UTC | |
|
Re: variable compare
by Laurent_R (Canon) on Jul 13, 2018 at 18:56 UTC |