in reply to Re: Struggling with complex data structures and doing useful operations on their elements and populating from arrays
in thread Struggling with complex data structures and doing useful operations on their elements and populating from arrays

Apologies

The %pets should be built from a loop thru the @info. The desired structure of the %pets is {scalar}{scalar}{array}{array} with no duplicated element in the {array} fields. The serves to summarize the data with no duplicates. The desired output would then to list the contents of each $pets{first}{last}{species}{color} on its own line, the combination {first}{last} is unique for the hash. The 2 arrays should be populated such that duplicate elements are discarded. This desired summarization is reflected in the desired output example. I have struggled with this little task for a couple of days now - my expertise is not quite sufficient enough yet ... but soon

  • Comment on Re^2: Struggling with complex data structures and doing useful operations on their elements and populating from arrays

Replies are listed 'Best First'.
Re^3: Struggling with complex data structures and doing useful operations on their elements and populating from arrays
by v-zor (Initiate) on Mar 13, 2015 at 06:26 UTC
    FYI, about the uniqueness in the array and sorting algorithm, you can use a prolog-like system to build your %pets. The trick is to negate clauses which are true so that your system inferes faster. It's a bit over the top but here's the stuff on CPAN : https://metacpan.org/search?q=prolog