perl 连接ldap问题

perl 连接ldap问题


foreach my $domain (<USERFILE>) {
chomp ($domain);
print “$domain\n”;
my $result = $ldap->add(
                            dn  => "ou=$domain,o=test",
                            attrs => [ "domainname"=>"$domain",
                                      "primarykey"=>"$domain",
                                      "modifier" =>"sAdmin",
                                      "createtime"=>"$ts",
                                     "modifytime"=>"$ts",
                                     "creator"  =>"sAdmin",
                                        "style"   =>"1",
                                       "deptou"  =>"0",
                                       "objectClass"=>"domainou"
                                   ]);
 
       $result -> code && die $result -> error;

我的设的变量domain,ldap不认,但是print可以打印出来,请问这是怎么回事