No, because lots of stuff is hidden. Consider what you have todo today
$mesg = $ldap->delete(@args); handle_referal($mesg) if (... check for referral ..);
vs
$ldap = Net::LDAP-.new(..., referral_connect => \&my_connect)
$mesg= $ldap->delete(@args);
Where referrals are done behind the scenes using &my_connect to create the connection
That doesn't help all that much, because the guts of handle_referal (sic)
are similar to my_connect. You're just moving code around a bit.
Not completely true, but I dont have to remember to add the line handle_referal after every method call. Its all done in one place and Net::LDAP calls it if needed.
Also, handle_referal will have to do the actual operation and insert the results into $mesg, but Net::LDAP will do that automatically. my_connect will _only_ create a connection and authenticate to the server, Net::LDAP will do everything else.
Graham.