in reply to Re: Re: Unique Variable names...
in thread Unique Variable names...

Actually, it does matter, and potentially might matter a lot. $x{$y} = \@z; takes a reference to a data structure that already exists. $x{$y} = [@z]; creates a new reference and copies the existing data structure into it. This can be an expensive operation. My operation will always occur in the same amount of time, regardless of how many elements there are in @z.

I suppose it wouldn't matter if you strictly used my @foo; every time the loop went around, but I think this way would be cleaner and less chance to bug up someplace..

Always using my @foo; every time the loop went around is both cleaner and less bug-prone. I am having the language handle my memory management for me. The language will always do it right - I might not. The rule of thumb is that if you're doing $x{$y} = [@z]; and you don't have a compelling reason why, you probably are doing something that is bug-prone and should rewrite it.

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.