[Wellington-pm] Complex data structure

Lesley Walker LRW at clear.net.nz
Wed Jul 26 23:15:41 PDT 2006

Is there a quick and simple way to reveal the contents of a complex data

I'm doing some things with LDAP, using a site-specific module which is
essentially a wrapper for Net::LDAP.  When I call the thingy that looks
up an LDAP entry, I get back a hash that will contain something like

  "cn=NeWS,ou=Services,dc=rhubarb,dc=co,dc=nz" => <HASH2>

where <HASH2> looks something like

  objectClass => ipService,
  cn => NeWS,
  cn => news
  ipServicePort => 144

except it's more complex that, because as you can see, "cn" appears
twice, and in fact any attribute can appear multiple times, and there's
another level of hashing that I don't quite understand. So a simple
"foreach ( keys %foo) { print <stuff> }" doesn't produce the desired

So, rather than spending all day reverse-engineering the structure of
this thing, is there some function or module that will just tell me
what's in it?

Lesley W
(the under-educated one)

More information about the Wellington-pm mailing list