Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^3: How to use regular expression for this?by graff (Chancellor) |
on Aug 13, 2005 at 00:13 UTC ( [id://483468]=note: print w/replies, xml ) | Need Help?? |
To elaborate on QM's If the two strings have the same character at the same offset, the XOR result will be zero (null byte); the "tr/\0/ /" operation will not only convert the nulls to spaces, but will also return the number of nulls found and converted. It's okay if the two strings are not the same length, because the shorter one will be padded with nulls as needed (and any value XOR 0 gives back that same value).
In Section
Seekers of Perl Wisdom
|
|