This if($line =~ /^\.+\$/) probably doesn't do what you want. To my eyes, it only matches a line that begins
.+$, but backslash $ doesn't seem to do anything other than mess up the match. You might try the Regular Expression test page. If that first line doesn't match, you never get anything in @listSection, so there's nothing to Dump.
Sometimes I can think of 6 impossible LDAP attributes before breakfast.