http://qs321.pair.com?node_id=1207362


in reply to Re: Pass array, then clear
in thread Pass array, then clear

I think my problem with all of this was a misunderstanding of the mechanics of calls to subroutines. I did not suspect that the subroutine made a copy of the memory address. I figured that by passing in a reference, then whatever I did to the reference would reflect the new state of the reference. I don't think this was an unreasonable expectation. If the mechanics were different, well it would be different. Suppose the variable passing used some sort of "slot based" mechanism where the caller/sub could agree on variables (references) in and their value (slot) on return? That could work. Maybe it's dumb, but I don't think it's as off the wall as expecting houses to be empty given a new key:)