You have it backwards. That code came from his using strict. When told he was using a variable he never declared, He simply declared it instead of fixing the code to use the right variable name.
Your solution is the code he had originally. While it undoes his second mistake, it leaves him with the first (not using the right variable).
In reply to Re^2: Loop through hash structure
by ikegami
in thread Loop through hash structure
by PerlScholar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |