#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    3
    Rep Power
    0

    Array_diff function failing in some cases


    array_diff function failing if the array has any of the two identical element.
    For example if I apply this function for array:
    @array1=qw(4,5,4,1,2) and @array2=qw(4,5,4,1,2)

    then it will fail...and say the Arrays dint match.

    But if I give only the unique elements in the array, it works, Eg.
    @array1=qw(4,5,1,2,3) and @array2=qw(4,5,1,2,3).

    ...I am planning to use this function to apply on big data base.
    So can anybody tell me the reason or alternate for this.
  2. #2
  3. kill 9, $$;
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2001
    Location
    Shanghai, An tSín
    Posts
    6,897
    Rep Power
    3886
    Can you post the array_diff function itself please?

IMN logo majestic logo threadwatch logo seochat tools logo