in reply to Can a hash key have a scalar value and also contain a hash?

Hi bcarroll,

I must confess I didn't get what you wanted done properly, but am sure what you are trying to do is not Impossible if properly expressed with a likely show of how the expected output is suppose to look like.
That been said, while you want to show that, you can also look at this documentation perldsc.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
  • Comment on Re: Can a hash key have a scalar value and also contain a hash?

Replies are listed 'Best First'.
Re^2: Can a hash key have a scalar value and also contain a hash?
by bcarroll (Pilgrim) on Jun 23, 2014 at 23:04 UTC
    Here is an example of the result I was dreaming of (given the example data):
    my $registry = loadreg('file.reg'); print $registry->{'SessionServer/NamespaceProviders'}; # would print 3 +2225 print $registry->{'SessionServer/NamespaceProviders'}{'ODBC'}; # would + print ssprovider_db print $registry->{'SessionServer/NamespaceProviders'}{'ODBC'}{'TYPE'}; + # would print REG_SZ