#!/usr/bin/perl
use DBI;
use strict;
my   $dbh = DBI->connect("DBI:LDAP:db.debian.org")  
      or die "Cannot connect as guest (readonly): " . $DBI::errstr;
my  $sth = $dbh->prepare("select cn, gecos, dkimPubKey from users where cn='Roland'")
      or die "Cannot prepare: " . $dbh->errstr();
$sth->execute() or die "Cannot execute: " . $sth->errstr();
my $cnt;     
while ((my @results) = $sth->fetchrow_array)
{
  print "--------------------------------------------------------\n";
  ++$cnt;
  while (@results) {
    print "------>".join('|',split(/\0/, shift(@results)))."\n";
  }
}
$sth->finish();
$dbh->disconnect();
