G'day htmanning,
"Is there anything wrong with this?"
The use of smart matching (~~) is experimental, so that's not good. It also looks like you're using (global) package variables: not good either - put use strict; at the start of your code and see what that tells you.
I rather agree with ++afoken's comment about using the SQL to get rid of the duplicates; however, for cases where you don't have that option, the classic, general solution would be something like:
my %seen; while (...) { next if $seen{$_}++; print; }
You introduced @list which didn't exist in your OP. You already have the data that's in that array:
keys %seen
— Ken
In reply to Re^3: Printing Categories from SQL search
by kcott
in thread Printing Categories from SQL search
by htmanning
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |