in reply to Comparing $_ --- before/after

Even if you really do have a good reason for not wanting to download and use what looks, at first glance, like a fairly short and simple pure-Perl module (String::Diff), why not just steal the code (with appropriate credit given, of course)?

Update: Oops... Just noticed that String::Diff is dependent on Algorithm::Diff, so maybe it's a little more involved than I first thought. Still, there's a lot of good code available...

Replies are listed 'Best First'.
Re^2: Comparing $_ --- before/after
by mrc (Sexton) on Oct 10, 2009 at 10:12 UTC
    The reason for not doing this, I want a simpler way instead of loading extra code from a module + installing some dependencies.
      Using a module is much simpler than writing and testing (don't forget to test it!) your own code which duplicates any but the most trivial functionality - and this particular problem is not exceptionally trivial. (It's not even well-defined yet... As an earlier response asked, what do you consider to be the difference between "Lazy Dog" and "Looney Owl"?)

      I'm not saying re-inventing wheels is bad - I do it all the time - but it does not make things simpler.

      Well, there's still a lot of code out there. Try a Super Search on  'string' and  'difference' (and similar terms) to get started with a lot of good leads.