You could probably use use B qw/svref_2object/; my $flags = svref_2object(\$val)->FLAGS;

Yes, I think that's the best one for the purpose I have in mind.
I'm thinking of proposing a test to check that List::Util::uniqnum() doesn't alter the numeric flags of its arguments when it doesn't need to.
My latest pull request was initially committing that very sin ... though I've since amended that PR such that uniqnum() no longer does that.
Strikes me that a test to check for such behaviour could be useful, and since List::Util is perl core, the test should utilize core modules only.
IIUC, that makes B the only option .... and therefore the best one ;-)

It's certainly handy to be aware of other candidates - and thank you for drawing my attention to Data::Peek.
I agree that it has a rather nice interface.

Cheers,
Rob

In reply to Re^2: Looking for a function that returns status of a scalar's numeric flags by syphilis
in thread Looking for a function that returns status of a scalar's numeric flags by syphilis

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.