|
|
| Pathologically Eclectic Rubbish Lister | |
| PerlMonks |
Re: Compare two strings of same length, character-by-characterby davido (Cardinal) |
| on Nov 29, 2023 at 23:15 UTC ( [id://11155954]=note: print w/replies, xml ) | Need Help?? |
|
Another option, that is mostly straightforward...
The output is:
This uses List::Util, which is a core Perl module, and aside from the slightly mysterious 'zip', reads like how a person would think through the problem; compare the first letter, compare the second, compare the third, and so on. No real magic that would require a #comment Dave
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||