|Just another Perl shrine|
Using SV as key in hashby liz (Monsignor)
|on Jul 16, 2006 at 22:53 UTC||Need Help??|
liz has asked for the
wisdom of the Perl Monks concerning the following question:
For my new Data::Reuse module (now on CPAN), I'm looking for a way to create a hash entry in which both the value as well as the key point to the same SV, or more general: set the hash key to a specific SV.
From what I've been able to learn from looking at a bunch of XS code, and [hs]v.[ch], the following code should do the trick:
which would then be called thus:
However, this produces the following output:
or, in other words, the value of the key is gone.
I guess my question to any XS savvy Perl Monk is:
Thanks in advance for any insights.