Revome over gsub()

That just iterates over the top level entries in the hash. If you need to recursively descend into hashes or arrays then you need something more like this.