A
Adam Funk
Srinivasan's "Advanced Perl Programming" (1997) says
--> Perl requires hash keys to be strings, so when you use a
--> reference as a key, Perl uses the reference's string
--> representation.... But when you later retrieve the key from
--> this hash, it will remain a string and will thus be unusable
--> as a reference. It is possible that a future release of Perl
--> may lift the restriction that hash keys have to be strings,
--> but for the moment, the only recourse ... is to use the
--> Tie::RefHash module.... There are few algorithms that
--> require references to be used as hash keys and fewer still
--> that cannot live with this restriction.
Is this still (5.8.x) the case? What practical effect does this
limitation have?
--> Perl requires hash keys to be strings, so when you use a
--> reference as a key, Perl uses the reference's string
--> representation.... But when you later retrieve the key from
--> this hash, it will remain a string and will thus be unusable
--> as a reference. It is possible that a future release of Perl
--> may lift the restriction that hash keys have to be strings,
--> but for the moment, the only recourse ... is to use the
--> Tie::RefHash module.... There are few algorithms that
--> require references to be used as hash keys and fewer still
--> that cannot live with this restriction.
Is this still (5.8.x) the case? What practical effect does this
limitation have?