Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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


Comment on Re^2: string diff and compare
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (14)
As of 2014-07-23 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (144 votes), past polls