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.
In reply to Re: unicode string comparison (perl 5.26)
by BillKSmith
in thread unicode string comparison (perl 5.26)
by md351
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |