natxo has asked for the wisdom of the Perl Monks concerning the following question:
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:
And I got it to work with this code:$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' };
Strangely, when using each %{ $hoh->{ $sid } } I get the error:while ( my ( $key, $value ) = each %{ $hoh{$sid} } ) { ... }
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).Global symbol "$hoh" requires explicit package name
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: each on reference is experimental take 2
by Mr. Muskrat (Canon) on Mar 10, 2016 at 19:47 UTC | |
by natxo (Scribe) on Mar 10, 2016 at 20:08 UTC | |
|
Re: each on reference is experimental take 2
by 1nickt (Canon) on Mar 10, 2016 at 18:30 UTC | |
|
Re: each on reference is experimental take 2
by hippo (Archbishop) on Mar 10, 2016 at 18:31 UTC | |
|
Re: each on reference is experimental take 2
by Anonymous Monk on Mar 10, 2016 at 20:21 UTC | |
by Anonymous Monk on Mar 10, 2016 at 21:15 UTC |