A while ago I posted a similar question (each on reference is experimental at) regarding a hash of arrays.

Now I have the same thing with a hash of hashes

while ( my ( $key, $value ) = each $hoh{$name} ) { do stuff; }

This works with a warning but I cannot seem to fix it without no warnings 'experimental' I have tried  each %$hoh{$name} but it did not help.

Any help greatly appreciated. update, this is the content of one of these HoH:

$VAR105 = 'S-1-5-21-xxxxxxxx-xxxxxxxxx-xxxxxxxxxxxx-xxxxx'; $VAR106 = { 'mail' => 'user@domain.tld', 'objectsid' => 'S-1-5-21-xxxxxxxx-xxxxxxxxx-xxxxxxxxxxxx-x +xxx', 'proxyaddresses' => [ 'X400:c=TLD;a= ;p=Domain;o=Exchange; +s=name;g=fn;', 'SMTP:name@domain.tld', 'smtp:name@domain.tld' ], 'givenname' => 'name', 'displayname' => 'name surname', 'sn' => 'surname', 'distinguishedname' => 'CN=name surname,OU=users,DC=domain +,DC=tld' };
And I got it to work with this code:

while ( my ( $key, $value ) = each %{ $hoh{$sid} } ) { ... }
Strangely, when using  each %{ $hoh->{ $sid } } I get the error:

Global symbol "$hoh" requires explicit package name
O well, it works every time is this reference stuff easier to work with, but it still trips me every now and then :-) Thanks all (again).

In reply to each on reference is experimental take 2 by natxo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.