Nit: Use $object->{ISBN} instead ... $$object{ISBN} can lead to subtle bugs.
I meant to ask before, and forgot: can you elaborate on this? Assuming for the moment that $object is a real reference here, not a "symbolic reference" string (we'll pretend for the moment that I was using strict; if the program were complex enough to span more than about half a dozen subroutines I would be), what subtle bugs would (or could) my syntax lead to? At first I thought you meant that someone might write $object{foo} by mistake instead of $$object{foo}, but then I realised warnings or strict either one would catch that, so you must be talking about something more subtle... but what?
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
In reply to That Nit (was Re: Parallel structures are NOT maintainable)
by jonadab
in thread using references as keys in a hash.
by habit_forming
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |