in reply to Re: Using Array::Diff
in thread Using Array::Diff

This does only one part of the job, because works only one way: it detects elements in @new_array and not in @old_array, but not elements in @old_array which are not in @new_array (i.e. deleted elements). Arrat::Diff does the check in both ways.

Also, if the lists are long, the performance is not very good because you have essentially two loops (the smat match over an array being an implicit loop), so the complexity is higher than using hashes (which Array::Diff does, if I remember correctly).

Replies are listed 'Best First'.
Re^3: Using Array::Diff
by james28909 (Deacon) on Dec 03, 2014 at 08:11 UTC
    Yes, I am learning/migrating some of my own script to use hashes as well. They are indeed much faster than arrays in the few tests I tried. Sometimes, (or more like all the time lol) I wish I could go through the perldocs and everything just sink in clear and understandable the first time around.