in reply to unicode string comparison (perl 5.26)
Your comments suggest that you are trying to determine whether or not the string in $last is a valid number. Neither of your attempts will do this (Not even with the syntactic corrections already posted). It is not clear what you mean by 'number'. If you mean an unsigned decimal integer, your first try is on the right track. A string is almost certainly an integer if it does not contain any non-digits ("\D").
if($last =~ m/\D/) { ... # Process as a non-integer string else { ... # Process the integer }
For any other definition of 'number', you probably should use a module.
Your error message is almost certainly from an unrelated problem. Fix this much and then post the offending code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: unicode string comparison (perl 5.26)
by Tux (Canon) on Nov 02, 2019 at 14:31 UTC | |
by BillKSmith (Monsignor) on Nov 02, 2019 at 19:00 UTC | |
|
Re^2: unicode string comparison (perl 5.26)
by afoken (Chancellor) on Nov 02, 2019 at 17:44 UTC | |
by BillKSmith (Monsignor) on Nov 02, 2019 at 18:52 UTC |