in reply to Looking for a function that returns status of a scalar's numeric flags
How about doing it via the guts? Search also perlapi for SvIOKp.
# author: bliako # for: https://perlmonks.org/?node_id=11114538 # 22/03/2020 use Inline 'C'; my $x; $x = "123"; flags($x); $x= 123; flags($x); $x= 123.123; flags($x); __END__ __C__ void flags(SV *sv){ printf("int=%d, double=%d, string=%d\n", SvIOKp(sv)>>12 & 1, SvNOKp(sv)>>13 & 1, SvPOKp(sv)>>14 & 1 ); }
bw, bliako
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Looking for a function that returns status of a scalar's numeric flags
by syphilis (Archbishop) on Mar 23, 2020 at 04:29 UTC |