in reply to pulling LDAP structure

The first thing that you should do is to add "use strict;" to your program, as well as turning on warnings, this will catch most of the variable creation and typo errors. I have rewritten part of your script to make it more perl-ish.

#!/usr/local/bin/perl -w use strict; my @attr_list = qw/ cn fonDeptName telephoneNumber l st fonManagerDN=cn /; # did you open the file? open LDAPFILE, ">ldap" or die "Can not create ldap"; # print column header print LDAPFILE "InputValue:", join(':', @attr_list), "\n"; close LDAPFILE; # ... # Set up a search pattern that will recognize any attribute. my $attrs = join '|', @attr_list; # <-- you probably want | instead o +f : ? # Create a hash with attribute names as search keys my %attrs = map { $_ => '' } @attr_list; # ... # ...