Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Looking for a function that returns status of a scalar's numeric flags

by syphilis (Bishop)
on Mar 23, 2020 at 03:57 UTC ( #11114558=note: print w/replies, xml ) Need Help??


in reply to Re: Looking for a function that returns status of a scalar's numeric flags
in thread Looking for a function that returns status of a scalar's numeric flags

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
  • Comment on Re^2: Looking for a function that returns status of a scalar's numeric flags
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11114558]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2020-05-27 10:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (154 votes). Check out past polls.

    Notices?