in reply to How can I test for the representation of an integer?

You cant, or well by design you are invited to treat scalar in a very permissive way.

From Modern Perl book:

The internal data structure which represents a scalar in Perl 5 has a numeric slot and a string slot.

The dualvar() function within the core Scalar::Util module allows you to manipulate both values directly within a single scalar. Similarly, the module’s looks_like_number() function returns true if the scalar value provided is something Perl 5 would interpret as a number.

Infact:
perl -MData::Dumper -E "say for Dumper([ 1, '1' ]),eval qq(1+'1'), len +gth qq(1....).1;" $VAR1 = [ 1, '1' ]; 2 6
L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.