Thanks for reporting your findings, I too am a great believer in empirical evidence, even if only as a prelude to verification via other routes. Deriving this understanding from the Perl sources would require considerably more familiarity than I currently have, or am likely to expend the time to aquire. Whilst I love Perl as a language, I absolutely hate having to delve into the source, it's like reading a completely different language rather than C.

<personal grouse>Effective as it is, why oh why isn't it at least indented properly. In this day an age when I routinely use a CLI window that has 160 characters of width and often push this to 200 when the need arises, why does everything have to be squashed up into the left-hand 50 chars? </personal grouse>

I'm not sure that I'll be making any use of the information though. Once you see what is involved in an LVALUE

perl> use Devel::Peek perl> $r = \substr('the quick brown fox', 10, 5) perl> print $r LVALUE(0x1bd2a70) perl> print $$r brown perl> Dump($r) SV = RV(0x1bd1cc0) at 0x1bd29f8 REFCNT = 1 FLAGS = (ROK) RV = 0x1bd2a70 SV = PVLV(0x1bc3388) at 0x1bd2a70 REFCNT = 1 FLAGS = (PADMY,GMG,SMG,pPOK) IV = 0 NV = 0 PV = 0x1bc37a8 "brown"\0 CUR = 5 LEN = 6 MAGIC = 0x1bc3338 MG_VIRTUAL = &PL_vtbl_substr MG_TYPE = 'x' TYPE = x TARGOFF = 10 TARGLEN = 5 TARG = 0x1bdf074 SV = PV(0x1bcd490) at 0x1bdf074 REFCNT = 1 FLAGS = (PADBUSY,POK,pPOK) PV = 0x1bc19f0 "the quick brown fox"\0 CUR = 19 LEN = 20

you realise that LVALUE refs are far from the 'cheap' utility that they appeared (to me at least) to be. That combined with their undocumented nature probably outweights any advantages that they might have provided.


In reply to Re: Re: LVALUE refs by BrowserUk
in thread LVALUE refs by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.