4 ms·
An example from Perl: you can use unicode characters in the source code with use utf8; This pragma tells perl to parse the source as UTF-8. It allows us to us
by infinity 15y ago
An example from Perl: you can use unicode characters in the source code with
use utf8;
This pragma tells perl to parse the source as UTF-8. It allows us to use unicode characters in string like this:
my $exampletext = 'Hallöchen Unicode! Ça va bien?';
And we can use unicode characters in identifiers:
my $γ = 2.5;
my $π = 3.14159;
my $θ = $γ / $π;
(This is not possible for subroutine and package names)
Using greek characters as identifiers could be useful for some people.
- chime 15y ago> my $θ = $γ / $π; > (This is not possible for subroutine and package names) > Using greek characters as identifiers could be useful for some people. That makes perfect sense and is a very good use-case for unicode variable names. Thanks!