in reply to How to check if a scalar value is numeric or string?

There is no practical difference between the values of '1' and 1. You could possibly dig into the guts of SVs and test whether your variable has been used as a number/string yet, but that would be a lot of work for questionable gains.

The real (XY problem) question is; why do you care? Perl will give you a string where appropriate (concatenation operation, say), and a number where appropriate (eg: addition operation)

  • Comment on Re: How to check if a scalar value is numeric or string?