I saw an article on perl script performance.
One of the things they mentioned is using hash references instead of accessing the hash directly each and everytime.
What benefit to do I gain from referring to the hash instead of a direct access?
My script reads from a list of server names that in theory could be as much as 100 machines if someone needed that many. So any boost I can give to my script would be great.
I don't think there's much of an advantage of $hashref->{"foo"}
over $hash{"foo"}
. There's probably a small advantage in passing hash refs instead of full hashes to subroutines, but that's about all I can think of. I agree with the comment by Rafe that a hash of 100 items isn't likely to give you performance problems either way. Unless you know you have a performance problem related to hash table access, don't bother with this.
"It's easier to optimize a debugged program than to debug an optimized program."