in reply to Re^2: Clear / Initialize multiple hashes
in thread Clear / Initialize multiple hashes
but later on if I want to clear all of them how should I go about it?
The simplest way is to scope them such that they get reinitialised by re-entering the scope each time you want to re-use them:
for( some loop condition or contruct ) { my( %hash1, %hash2, %hash3 ); ## do stuff with them ... }
Each time that loop iterates, the hashes will be reinitialised for you.
But, it you really need to do it manually, you could use:
undef %$_ for \(%h1,%h2,%h3);
|
|---|