Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^2: Using Array::Diffby Laurent_R (Canon) |
on Dec 03, 2014 at 07:48 UTC ( [id://1109083]=note: print w/replies, xml ) | Need Help?? |
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).
In Section
Seekers of Perl Wisdom
|
|