# New Ticket Created by "B O"
# Please include the string: [perl #128301]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=128301 >

Hi everyone,

I have spoken to Zefram and TonyC on #p5p, and apparently it's not well
documented in perl which operations will eagerly create hash elements. In
foo(\$x{bla}), for example, the \ is treating its operand as an lvalue,
same as if it were on the lhs of an assignment like that. Now, foo($x{bla})
*also* treats $x{bla} as an lvalue, but doesn't eagerly create it. Instead,
it passes a PVLV to foo(), which can then create the hash element by
assigning to $_[0].

Function arguments are usually taken by value but there's no type
information to say which arguments specifically are taken by reference and
so need the lvalue treatment. This patch adds two extra tests for that
behaviour, so at least we can check whether they remain consistent.

Hope it helps :)


Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupperl5-porters @
postedMay 31, '16 at 12:29p
activeMay 31, '16 at 12:29p

1 user in discussion

B O: 1 post



site design / logo © 2022 Grokbase