in reply to Hash problem

Why there isn't any function in perl that deletes everything in a hash, removes keys, and deletes it such that it is like just it was declered

Either of the following will do it:

undef %hash; %hash = ();

The error you gave doesn't make a lot of sense without some context.