in reply to Re^10: Any good ways to handle NARROW NO-BREAK SPACE characters in regex in newer versions of Perl?
in thread Any good ways to handle NARROW NO-BREAK SPACE characters in regex in newer versions of Perl?

PerlMonks website added them in. I just forgot to delete them. But they are narrow non-breaking space characters.

$PM = "Perl Monk's";
$MC = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar Parson";
$nysus = $PM . ' ' . $MC;
Click here if you love Perl Monks

  • Comment on Re^11: Any good ways to handle NARROW NO-BREAK SPACE characters in regex in newer versions of Perl?

Replies are listed 'Best First'.
Re^12: Any good ways to handle NARROW NO-BREAK SPACE characters in regex in newer versions of Perl?
by Corion (Patriarch) on Aug 13, 2024 at 17:52 UTC

    Yes, but they are what I mean by "literals". If you have any byte above 127 in your source code, you need to tell Perl what encoding your source code is in if it is not Latin-1.

    You have something that is UTF-8, but you are not telling Perl that your source code contains UTF-8.

      Well, through all this frustration I learned something. I mistakenly assumed utf8 was turned on with `use v5.36`. And when I did try `use utf8`, other problems in my code masked the issue.

      $PM = "Perl Monk's";
      $MC = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar Parson";
      $nysus = $PM . ' ' . $MC;
      Click here if you love Perl Monks