operator ~ (“NOT”) is used to negate a filter. This expression will select only entries that do not have an objectclass
attribute:
f = ~ Net::LDAP::Filter.pres( "objectclass" )
– This operator can’t be !, evidently. Try it. Removed GT and LT. They’re not in the RFC.