if($controls[0] and $controls[0]->isa('Net::LDAP::Control::SyncState')) { print "Received Sync State Control\n"; ...}