in reply to Re^4: Efficient way to verify scalar contents
in thread Efficient way to verify scalar contents
Note that both of your solutions don't report an error for e.g. 'aaaaaaaaa0-' and 'aaaaaaaaaaaaaaaaaaa', which are invalid as per the OP's code.
In Section
Seekers of Perl Wisdom