in reply to Subroutining for readability...
Both have advantages (the first pair has fewer arguments, the second avoids duplicate code). You might consider combining them by having a _modify_generic_directory that is called with apropriate arguments by wrapper subs that provide the needed parameters. That way you aren't duplicating the LDAP code in n different subs, but you reduce the amount of parameters callers have to provide.
And if you're really feeling OOP-y, you might even go as far as creating your own class that keeps all of the things like the LDAP info and what not in the instance rather than explicitly passing gobs of parameters.
|
|---|