If it's any easier, think of my as malloc(). Inside a while loop, the my variable goes out of scope each iteration, so the storage may be reclaimed. To get the same effect with a goto loop, you'll need explicit block scoping:
again: { my $h; } goto again;
In reply to Re^7: "goto" memory leak
by Anonymous Monk
in thread "goto" memory leak
by jethro
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |