pme has asked for the wisdom of the Perl Monks concerning the following question:
Can you tell me why this example below does not work in perl v5.28?
It is from book http://modernperlbooks.com/books/modern_perl_2016/03-perl-language.html#VW5pY29kZWFuZFN0cmluZ3M by chromatic.use utf8; sub £_to_₯ { ... } my $yen = £_to_₯('1000£');
This is my tiny script and its output with diagnostics.
Output:#!/usr/bin/perl use strict; use warnings; use diagnostics; use utf8; use feature qw/say/; binmode STDOUT, ":utf8"; my $ = 1; say '------------------------';
Unrecognized character \x{20ac}; marked by <-- HERE after my $<-- HERE + near column 5 at ./uni2.pl line 10 (#1) (F) The Perl parser has no idea what to do with the specified char +acter in your Perl script (or eval) near the specified column. Perhaps +you tried to run a compressed script, a binary program, or a director +y as a Perl program. Uncaught exception from user code: Unrecognized character \x{20ac}; marked by <-- HERE after my $<-- +HERE near column 5 at ./uni2.pl line 10.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Currency symbols in variable names
by davido (Cardinal) on Aug 26, 2019 at 05:48 UTC | |
by pme (Monsignor) on Aug 28, 2019 at 07:01 UTC | |
|
Re: Currency symbols in variable names
by 1nickt (Canon) on Aug 25, 2019 at 10:55 UTC | |
by pme (Monsignor) on Aug 25, 2019 at 11:39 UTC | |
by 1nickt (Canon) on Aug 25, 2019 at 14:33 UTC | |
by pme (Monsignor) on Aug 25, 2019 at 15:49 UTC | |
|
Re: Currency symbols in variable names
by jcb (Parson) on Aug 26, 2019 at 00:44 UTC | |
|
Re: Currency symbols in variable names
by holli (Abbot) on Aug 25, 2019 at 10:57 UTC | |
by pme (Monsignor) on Aug 25, 2019 at 11:43 UTC |