Hey Robert,
This is clunky, but have you tried declaring an array variable with
maxPwdAge and passing in the reference to the array within the search?
ex
my @attrlist = qw(maxPwdAge);
my $mesg = $ldap->search( base => $ROOTDN,
attrs => \@attrlist,
scope => 'base',
filter => "distinguishedName=$ROOTDN"
);
-Jerome
On Thu, Jan 2, 2014 at 4:58 PM, Robert Lowe <[email protected]> wrote:
> Forwarding per Graham's suggestion... any insight would be greatly
> appreciated!!!
>
> -Robert
>
> ---------- Forwarded message ----------
> From: Graham Barr <[email protected]>
> Date: Thu, Jan 2, 2014 at 3:42 PM
> Subject: Re: Convert::ASN1 error
> To: Robert Lowe <[email protected]>
>
>
> Everything looks right to me, but I have not worked with Net::LDAP for
> sometime myself. there is a list [email protected] that may be able to help,
> Convert::ASN1 has not changed in a long time so if this is the cause of a
> code change it is likely to be in Net::LDAP
>
>
> On Dec 31, 2013, at 14:49 , Robert Lowe <[email protected]> wrote:
>
> Hi,
>
> I'm using Net::LDAP (see code snippet below, which worked for several
> years), which calls Convert::ASN1 somewhere and in turn generates the
> following error:
>
> Can not use string ("maxPwdAge") as an ARRAY ref while "strict refs" in
> use at / usr/share/perl5/vendor_perl/Convert/ASN1/_encode.pm line 269.
>
> My fault? Or somewhere else? If you'd like I can send you the entire
> script, but if this is a known issue, I thought you'd know right.
>
> --
>
> # Retrieve the maxPwdAge field
> my $mesg = $ldap->search( base => $ROOTDN,
> attrs => [ 'maxPwdAge' ],
> scope => 'base',
> filter => "distinguishedName=$ROOTDN"
> );
>
> # Die if there was an error
> $mesg->code && die $mesg->error;
>
> # Get the first entry
> my $entry = $mesg->entry(0);
>
> # Get the maxPwdAge attribute -- it is maximum age of a password in
> # 10 millionths of a second before expiration.
> # For some reason, this value is negative.
> my $maxPwdAge = $entry->get_value( 'maxPwdAge' );
>
> -Robert
>
>
>
>
--
~Jerome