P.S. To directly answer your question (and make a minor correction*)
Would that be because %hash only springs up in the scope of the subroutine,
No, undeclared variables (when strict vars is not in use) are package variables (global), see e.g. our. In this case, there are two, the scalar $hash which holds a reference to an anonymous hash (the data structure being used in this code), and %hash, a hash which is only read from in one place in the code, which is why it remains almost empty*.
* The dereference operation actually autovivifies some empty anonymous hashes:
print Dumper(\%hash); __END__ $VAR1 = { 'user2' => {}, 'user3' => {}, 'user1' => {} };
In reply to Re^2: Question about the symbol table
by Anonymous Monk
in thread Question about the symbol table
by Cristoforo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |