Well, what I did, because I needed to talk to two different AD domains, was to create two krb5.conf files.
Example: Two companies, two domains, call them ZAY and BXC. First configure your krb5.conf file for connecting to the ZAY domain. Once you're able to kinit and net join to that domain, copy the krb5.conf to zay-krb5.conf.
Next, configure the krb5.conf file to connect to the BXC domain. Once you're able to kinit and net join to that domain, copy the krb5.conf to bxc-krb5.conf.
Once you know which domain you want to talk to, lets assume zay for this example, do this:
export KRB5_CONFIG='zay-krb5.conf'; perl <script name>