[aklug] Re: slightly OT: Perl Net::LDAP

From: Royce Williams <royce@tycho.org>
Date: Fri May 20 2016 - 10:10:22 AKDT

On Fri, May 20, 2016 at 9:49 AM, Todor Fassl <fassl.tod@gmail.com> wrote:
> Essentially, my question is, in perl, what is the difference between
> saying:
>
> $array = ['one' => 1, 'two' => 2];
>
> and
>
> $array = {'one' => 1, 'two' => 2};
>
> I am trying to write an ldap add function in perl. Something in the
> documentation puzzles me:
> http://search.cpan.org/~gbarr/perl-ldap-0.33/lib/Net/LDAP.pod
>
> That page shows the second parameter to the add function being a anonymous
> array ref created by using brackets, '[ ... ]'.
>
> But then it appears to use string keys. Doesn't that make it a hash or an
> associative array? Therefore, shouldn't it be instantiated with braces, "{
> ... }"?
>
> --
> Tod

Braces mean a hash reference.

http://stackoverflow.com/a/11839874

Royce
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Fri May 20 10:11:17 2016

This archive was generated by hypermail 2.1.8 : Fri May 20 2016 - 10:11:17 AKDT