• 0

linked hashes in perl


Question

Hi,

Does anyone know why this code produce these results?

Have problems with the hash value being overwritten after a different one is defined.

$sample{1}='empty';

$sample{1}{length}=1;

printing this $sample{1}{length} will produce value of 1

$anotherSample{1}='empty';

$anotherSample{1}{length}=56;

printing this $sample{1}{length} will now produce value 56 ???

The different hash name shouldn't have overwritten first hash value.

Thanks

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.