by infinity · 15y ago · 0 comments
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.
> (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!