in reply to Re^2: unicode string comparison (perl 5.26)
in thread unicode string comparison (perl 5.26)

haj was noting that the line

$last=$s/\s+//g;  #clean it up

should be

$last =~ $s/\s+//g;  #clean it up

Are you able to provide some example data for others to test with?

Also, your code does not compile. The if ($last !~/\d/) {...} or if($last=~/[^/x00-\x7f]) {...} block should be if ($last !~/\d/) {...} elsif ($last=~/[^/x00-\x7f]) {...}

Replies are listed 'Best First'.
Re^4: unicode string comparison (perl 5.26)
by AnomalousMonk (Archbishop) on Nov 01, 2019 at 19:24 UTC

    Note also that the inverted character set in  $last=~/[^/x00-\x7f] (missing closing / forward slash for regex, unescaped forward slash in pattern) should probably be  [^\x00-\x7f] (backslash vice forward slash); otherwise,  [^/x00-\x7f] is the same as  [^\/-\x7f].

    Update: Oops... choroba already mentioned the point about  [^\x00-\x7f] vs  [^/x00-\x7f] here; didn't read that far before I posted.


    Give a man a fish:  <%-{-{-{-<