How can I put an array (like the tuple in the following example) into a hash in Perl?
%h=();
@a=(1,1);
$h{@a}=1 or $h{\@a}=1??
I tried with an array reference, but it does not work. How do I to make it work? I want to essentially de-duplicate by doing the hashing (among other things with this).
$h{join "\x00", @a} = 1.$;to form a key. This is not to be encouraged. See perlvar for a description.$;- the subscript separator. The value was chosen because it is the same as AWK uses forSUBSEP. Read about it inperlvar.