My apologies I am not a perl programmer I come from the Linux side. 1. I now have the code as :-
. . .use Data::Dumper; use Net::LDAP; use Net::LDAP::Control::Paged; use Net::LDAP::Constant ( "LDAP_CONTROL_PAGED" );
I do not get any outputwhile(1) { # Perform search my $mesg = $ldap->search( @args ); # Filtering results for proxyAddresses attributes foreach my $entry ( $mesg->entries ) { my $name = $entry->get_value( "cn" ); # LDAP Attributes are multi-valued, so we have to print each one. foreach my $mail ( $entry->get_value( "proxyAddresses" ) ) { # Test if the Line starts with one of the following lines: # proxyAddresses: [smtp|SMTP]: # and also discard this starting string, so that $mail is only th +e # address without any other characters... if ( $mail =~ s/^(smtp|SMTP)://gs ) { push(@valid, $mail." OK\n"); print Dumper($mail); } }
Using Poj's Suggesstion:- I get this error message:- root@vm1000 getadscripts# ./getadsmtp_itbak1.pl Name "main::valid" used only once: possible typo at ./getadsmtp_itbak1.pl line 116, <DATA> line 755. $VAR1 = '/etc/postfix/ad_itdepartment';
In reply to Re^4: Centos 7 getadsmtp.pl outputing blank
by gml_perl
in thread Centos 7 getadsmtp.pl outputing blank
by gml_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |