in reply to Re: using references as keys in a hash.
in thread using references as keys in a hash.

Ironically, your code snippets above try to use references as keys, although unintentionally. The lines I'm referring to are   %nestedhash = { and   my %thisrecord = { ref => $ref, val => $val }; Both should be using parentheses instead of curly brackets.

ihb

Replies are listed 'Best First'.
Re: using references as keys in a hash.
by jonadab (Parson) on Feb 25, 2003 at 05:44 UTC

    Quite so. That'll teach me to post without testing.


    sub H{$_=shift;while($_){$c=0;while(s/^2//){$c++;}s/^4//;$ v.=(' ','|','_',"\n",'\\','/')[$c]}$v}sub A{$_=shift;while ($_){$d=hex chop;for(1..4){$pl.=($d%2)?4:2;$d>>=1}}$pl}$H= "16f6da116f6db14b4b0906c4f324";print H(A($H)) # -- jonadab