in reply to Re^7: ref eq "REF"
in thread ref == "REF"
Hash keys accept only string values because it was a lowercase-p-perl design decision to make them string values. This didn't have to be the case! Trading off efficiency, hv_store and friends could have accepted RVs as well. The dual value issue you raise is indeed different, and more vexing in this case, because if you were to use a multi-valued SV as a hash key, confusion would probably arise about which value you wanted to be definitive (or if you wanted to require subsequent SVs to have *both* values determine the lookup). This is not a problem with references as keys.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: ref eq "REF"
by revdiablo (Prior) on Oct 18, 2004 at 23:18 UTC | |
by gaal (Parson) on Oct 19, 2004 at 10:00 UTC |