On 18 Aug 2004, at 14:55, Mark Drummond wrote:

Hi all. I am having trouble trying to figure out how to code some sort of "has value" functionality. Specifically, I have a script which will walk a DIT, adding a few objectclasses and attributes if those are not already present. I am looking for a way to say "if this objectclass does not exits, then add it". Is there some way to say "if $entry->get_values('objectclass') does not contain "foo", then add foo"?

how about

  unless ( grep { $_ eq "foo" } $entry->get_values('objectclass')) {
    ...
  }

Graham.



Reply via email to