If they're redundant, don't do them. Generally speaking, though, they're not redundant. The outcome of each test is independent of the others. Magic can be tied to an element without being tied to the array, and the use of GET and SET magic is independent.

$ perl -MDevel::Peek -E' sub TIESCALAR { bless \my $x; } sub FETCH { 3 } my @a = (6,7); tie $a[1], __PACKAGE__; say $a[0]; say $a[1]; Dump(\@a); ' 6 3 SV = IV(0x9a22324) at 0x9a22328 REFCNT = 1 FLAGS = (TEMP,ROK) RV = 0x9a3c2e8 SV = PVAV(0x9a23174) at 0x9a3c2e8 REFCNT = 2 FLAGS = (PADMY) ARRAY = 0x9a3af28 FILL = 1 MAX = 3 ARYLEN = 0x0 FLAGS = (REAL) Elt No. 0 SV = IV(0x9a21764) at 0x9a21768 REFCNT = 1 FLAGS = (IOK,pIOK) IV = 6 Elt No. 1 SV = PVMG(0x9a64d50) at 0x9a21898 REFCNT = 1 FLAGS = (GMG,SMG,RMG,pIOK,pPOK) IV = 3 NV = 0 PV = 0x9a370d0 "3"\0 CUR = 1 LEN = 12 MAGIC = 0x9a46460 MG_VIRTUAL = &PL_vtbl_packelem MG_TYPE = PERL_MAGIC_tiedscalar(q) MG_FLAGS = 0x02 REFCOUNTED MG_OBJ = 0x9a22258 SV = IV(0x9a22254) at 0x9a22258 REFCNT = 1 FLAGS = (ROK) RV = 0x9a4f4a0

In reply to Re^7: XS: returning a 64-bit unsigned int? by ikegami
in thread XS: returning a 64-bit unsigned int? 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.