U
usenet
I wish to construct a subroutine which will accept two strings and
return True if they differ by ONLY one "extra" character
(case-sensitive). For example, it would return true if passed qw/Perl
Pearl/, but false for qw/Perl Preal/. It would be nice if it could also
identify single-character variances (without an additional character,
ie, qw/Perl Pell/ or qw/Perl perl/)
I suspect there's a module that will save me the bother of writing an
ugly, brute-force, one-character-at-a-time parser/comparitor. I had a
look at Text:
iff but it doesn't seem to fill this particular need
(and, of course, it's not designed to). And I looked at a few others as
well, but no luck (I couldn't even figure out what Text::Compare is
supposed to do!).
I can write the ugly code (I'm pretty good at that!), but I'd
appreciate anyone who can refer me to something better.
return True if they differ by ONLY one "extra" character
(case-sensitive). For example, it would return true if passed qw/Perl
Pearl/, but false for qw/Perl Preal/. It would be nice if it could also
identify single-character variances (without an additional character,
ie, qw/Perl Pell/ or qw/Perl perl/)
I suspect there's a module that will save me the bother of writing an
ugly, brute-force, one-character-at-a-time parser/comparitor. I had a
look at Text:
(and, of course, it's not designed to). And I looked at a few others as
well, but no luck (I couldn't even figure out what Text::Compare is
supposed to do!).
I can write the ugly code (I'm pretty good at that!), but I'd
appreciate anyone who can refer me to something better.