in reply to Re: is it an array?
in thread is it an array?

From my perspective, this is an excellent response. I was struggling a bit by the OP's comment that

"each key may or may not be an array."

since an array as a hash key uses the stringified reference address as the key rather than any of the array's constituents.

It seemed like the OP wanted the contents of the array to somehow be the key(s). But I may have not been properly understanding what the OP was seeking. I always get a bit nervous when someone uses either array or hash references as 'keys' to hashes or as indecies for arrays.

Just MHO, YMMV.

ack Albuquerque, NM

Replies are listed 'Best First'.
Re^3: is it an array?
by rkrieger (Friar) on Jan 20, 2010 at 20:57 UTC

    This is probably going off-topic. From the LDIF structure displayed and the mention of %ldif, I assumed the keys are 'sn', 'mail', etc. What the keys are, rather, would correspond to the contents of $ldif{'sn'}.

    Since $ldif{$key} either contains a scalar value or (a reference to) an array, this seemed the simplest way to fit things together. I can see the use in having the attributes for an LDAP entry as keys in your hash.

    I don't directly see much point on the contents being useful as keys to an array, but that doesn't mean that there couldn't be any :)