Create a function to test if a value belongs to a list
Summary
I've seen that question asked at least twice on the mailing list: How do we check that a multi-valued ldap attribute contains a particular value.
The "official" answer is `$attr ~ /\bvalue\b/' but:
- Only perl monks understand this syntax anymore
- It doesn't work if $attr is a hashref / arrayref
We need an extended function to handle these cases gracefully. As a bonus if could also replace the defined hGroups->{'groupname'}
syntax
Design proposition
listMatch($variable, 'value')
It should work with:
- arrayrefs
- hashrefs
- flat strings separated by multiValueSeparator