in reply to Re: Generate Array of Hashes WITHOUT References
in thread Generate Array of Hashes WITHOUT References
I like to avoid references where there's a simple alternative, because in my case it saves brain power. I seemed to recall that this could be done without this kind of method:
$rec->{$key} = $value;
and it seems I was right, as I can use:
$rec{$key} = $value;
and I see no advantage of the former method, as the latter is more familiar, concise, and simpler for me, so that's what I'll use. It seems the only place I need to refer to the hash as a reference is when I push it onto the array, which I'm OK with.
|
|---|