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

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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://968914]
help
Chatterbox?
[marto]: Discipulus Let's discuss Podmaster's Signature and the response from tye
[Discipulus]: thanks marto i'll read it after an urgent phonecall

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2017-06-23 09:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (539 votes). Check out past polls.