http://qs321.pair.com?node_id=1159205


in reply to Re^6: "goto" memory leak
in thread "goto" memory leak

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;