http://www.perlmonks.org?node_id=1217664


in reply to Re^2: Centos 7 getadsmtp.pl outputing blank
in thread Centos 7 getadsmtp.pl outputing blank

I am not so sure how to include Data::Dumper or print statements into the code.

So I take it you're not a Perl programmer? I would suggest you read perlintro, it's not very long and it'll give you a good idea of Perl's syntax. Then, you can insert use Data::Dumper; above the line use Net::LDAP;, and at various places in the code, insert print Dumper($variable); or print Dumper(\@array); statements to get debug output, which you can compare across the two machines, or post here for feedback, if you like.

Just for example, you might insert print Dumper($mail); inside the loop foreach my $mail ( $entry->get_value( "proxyAddresses" ) ) { ... } to see which, if any, mail addresses you are getting and whether they match the pattern /^(smtp|SMTP):/. You can repeat this for the other loops to see how many times those loops get executed, etc.

Perl version for the successful script is 0.4001 and where it is failing 0.65.

Have you had a chance to investigate poj's suggestion?