good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Is A Numberby BillKSmith (Monsignor) |
on Dec 18, 2021 at 23:25 UTC ( [id://11139711]=note: print w/replies, xml ) | Need Help?? |
I agree with the other monks that the module is the best solution if you want to know if perl considers your string a number. But I will try to answer your original question. It is actually better to only test for the valid cases, and assume that it is invalid otherwise. The following code is a simplified version of yours.
OUTPUT:
Bill
In Section
Seekers of Perl Wisdom
|
|