Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Centos 7 outputing blank

by poj (Abbot)
on Jun 13, 2018 at 12:21 UTC ( #1216552=note: print w/replies, xml ) Need Help??

in reply to Centos 7 outputing blank

At version 0.58 (Dec 2013) the example code in LDAP::Control::Paged was changed (bug fix RT#91210: fix example code) from what you have to this.

my $cookie; while (1) { # Perform search my $mesg = $ldap->search( @args ); # add you code here for # Filtering results for proxyAddresses attributes # Only continue on LDAP_SUCCESS $mesg->code and last; # Get cookie from paged control my($resp) = $mesg->control( LDAP_CONTROL_PAGED ) or last; $cookie = $resp->cookie; # Only continue if cookie is nonempty (= we're not done) last if (!defined($cookie) || !length($cookie)); # Set cookie in paged control $page->cookie($cookie); } if (defined($cookie) && length($cookie)) { # We had an abnormal exit, so let the server know we do not want an +y more $page->cookie($cookie); $page->size(0); $ldap->search( @args ); }

I'm not sure it's relevant but probably worth a try.


Replies are listed 'Best First'.
Re^2: Centos 7 outputing blank
by nycspud (Initiate) on Aug 27, 2019 at 20:15 UTC
    Here in 2019, it turns out someone had used this same script to pull email addresses from our AD server as well. It wouldn't work on CentOS7 so following the troubleshooting tips from poj, I added the line:
    print "mesg = ".Dumper($mesg);
    It gave me this message:
    'errorMessage' => 'Can\'t use string ("proxyAddresses") as an ARRAY re +f while "strict refs" in use at /usr/share/perl5/vendor_perl/Convert/ +ASN1/ line 269, <DATA> line 747.
    So I changed attr => "proxyAddresses to attr => "@proxyAddresses" and the script dumped all email addresses to a file. although it generated the following warnings:
    Possible unintended interpolation of @proxyAddresses in string at ./p. +pl line 84, <DATA> line 747. Name "main::proxyAddresses" used only once: possible typo at ./ li +ne 84, <DATA> line 747.
      Possible unintended interpolation of @proxyAddresses in string

      @ must be escaped in double quoted strings, and because you don't have an array named @proxyAddress, "@proxyAddress" evaluates to an empty string.

      Another option is to use single quotes instead of double quotes.


      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
        I declared the array before it was used and that cleared the warning messages. Thanks to everyone on this thread for helping to get this working!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1216552]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2021-05-09 15:47 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (100 votes). Check out past polls.