http://www.perlmonks.org?node_id=928134


in reply to Re^7: XS: returning a 64-bit unsigned int?
in thread XS: returning a 64-bit unsigned int?

Magic can be tied to an element without being tied to the array.

I know. That's why it is so expensive to cater for.

The fact that almost no one uses tied scalars for anything makes it all the worse.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^8: XS: returning a 64-bit unsigned int?

Replies are listed 'Best First'.
Re^9: XS: returning a 64-bit unsigned int?
by ikegami (Patriarch) on Sep 27, 2011 at 18:15 UTC

    Tie is only one kind of magic. Magic scalars are actually quite common.

    $1 $| $ENV{PATH} $ISA[0] $tied{$k} $tied[$i] $#a pos substr

    (Some of these only return magical scalars in lvalue context.)

    Every tied hash and array uses them in order to call STORE on the hash or array when assigning to the scalar returned by $tied{$i} and $tied[$i].

      And how many of those am I going to find inside an array?


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        Of those, every element of @ISA and every element of a tied array are found in arrays.