%temp is actually a container - think of a bucket. You can fill this container (putting water into the bucket), and empty it, which is what %temp = undef does.
Or you can but your bucket into the cupboard, (pushing it to an array), and take a new bucket (declaring %temp inside the loop).
In this real-world analogy you can see that there's a huge difference between these two things.
In reply to Re^3: hash references
by moritz
in thread hash refferences
by leonidlm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |