<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div>It could be anything in Perl's mind I guess. :)</div><div><br data-mce-bogus="1"></div><div>[ 1, 2 ] is basically the same as { '1' => '2' } from our view. Net::LDAP developers may have just decided to stick with array references so that they did not have to deal with hash vs array. You could just cast it to either.</div><div><br data-mce-bogus="1"></div><div>I thought that maybe using the array and casting to hash would preserve ordering, but the order is still random.</div><div><br data-mce-bogus="1"></div><div>my $hash = {<br> '1' => 'One',<br> '2' => 'Two'<br> };<br><br>print "Hash:\n";<br>foreach my $ref (keys %{$hash}) {<br> print "$ref\n";<br>}<br><br><br>my $array = [ '1' => 'One', '2' => 'Two' ];<br><br>print "Array:\n";<br>foreach my $ref (@{$array}) {<br> print "$ref\n";<br>}<br><br>my %hasher = @{$array};<br><br>print "Array:\n";<br>foreach (keys %hasher) {<br> print "$ref\n";<br>}<br></div><div><br></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Todor Fassl" <fassl.tod@gmail.com><br><b>To: </b>"Chris Fowler" <cfowler@outpostsentinel.com>, "Atlanta Linux Enthusiasts" <ale@ale.org><br><b>Sent: </b>Tuesday, May 24, 2016 5:21:05 PM<br><b>Subject: </b>Re: [ale] perl bogosity<br></blockquote></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;">Are you sure about that?<br><br>$ perl -e 'print ref({ "key" => "value" }) . "\n";'<br>HASH<br>$ perl -e 'print ref([ "key" => "value" ]) . "\n";'<br>ARRAY<br><br>Using the Data::Dumper module, it looks like [ 'key' => 'value' ] <br>creates an anonymous reference to an array with 2 elements.<br><br>On 05/24/2016 03:10 PM, Chris Fowler wrote:<br> > [ 'key' => 'value' ] is an associative array like that.<br> ><br><br>-- <br>Todd<br></blockquote></div></div></body></html>