Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^2: string diff and compare

by raybies (Chaplain)
on May 04, 2012 at 12:03 UTC ( #968914=note: print w/ replies, xml ) Need Help??

in reply to Re: string diff and compare
in thread string diff and compare

Thanks jw!

I fixed the errors (my internet machine, and my Perl are on two different systems, and I copied it by hand...).

The optimizations are really interesting (still pondering it in awe...), I didn't know about @+ til this example. That makes matching strings so much better than having to pull them appart into seperate character arrays. The trick of using negative subscripts is really cool too. Thanks for taking the time to respond, it's little things like this that makes Perl a pure expression of algorithmic joy... :-D

Comment on Re^2: string diff and compare
Replies are listed 'Best First'.
Re^3: string diff and compare
by jwkrahn (Monsignor) on May 04, 2012 at 21:22 UTC
    I fixed the errors

    Except for this one:

    my $longer = (@cold > @new) ? $#cold : $#new;

    Which should be:

    my $longer = (@cold > @cnew) ? $#cold : $#cnew;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://968914]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2015-11-28 20:17 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (744 votes), past polls