Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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

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: (14)
As of 2016-10-27 16:30 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (366 votes). Check out past polls.