in reply to Re^2: Dereferencing in blessed object
in thread Dereferencing in blessed object
Why is this preferable to $$vars{test}?
I don't see objectively why it would be, TBH. If you start getting into deeper structures then the increasing levels of syntax needed to deal with the $$foo{bar} equivalents is going to get messy. For a simple hash though there's little difference.
Personally I do use the arrow operator as it (subjectively) stands out more clearly to me in an eye-parse. But I do not quote hash keys (whether in references or otherwise) unless necessary. If I see code like $vars->{'test'} it makes me pause and wonder why the key is quoted.
Whatever you decide to do, make a plan and stick to it. Having your own coding standard, at least within one project, will be a benefit. Inconsistency is the bug's friend.
🦛
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Dereferencing in blessed object
by stevieb (Canon) on Feb 26, 2021 at 16:27 UTC | |
|
Re^4: Dereferencing in blessed object
by LanX (Saint) on Feb 26, 2021 at 12:52 UTC | |
by hippo (Archbishop) on Feb 26, 2021 at 14:56 UTC | |
by LanX (Saint) on Feb 26, 2021 at 15:34 UTC | |
by haukex (Archbishop) on Feb 26, 2021 at 13:22 UTC | |
by LanX (Saint) on Feb 26, 2021 at 13:32 UTC |