Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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?
[ambrus]: My boss wants to generate output data that is impossible to compute from the inputs we have. And I'm trying to convince him that he shouldn't do that.

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2017-12-12 12:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (332 votes). Check out past polls.

    Notices?