Distiguishing arguments: number-strings vs real integerby LanX (Cardinal)
|on Aug 09, 2018 at 22:51 UTC||Need Help??|
LanX has asked for the wisdom of the Perl Monks concerning the following question:
I want to find out if a function is called with an integer or a string containing an integer.
Perl tries to hide what the scalar internally is, but Devel::Peek can be used here, the flag IOK shows an integer, POK a string.
looks_like_number() is no help here, I want the exact opposite.
Is there a more elegant way than catching and parsing the output of Dump?°
NB: Using PerlGuts optree vodoo is considered helpful but not more elegant ... ;)
°) which involves redirecting STDERR ... Yuck!!!