It's a little misleading to claim that the first snippet works. Enable strict and you get
$ perl -Mv5.40 -e'my $x= Inf; say $x' Bareword "Inf" not allowed while "strict subs" in use at -e line 1. Execution of -e aborted due to compilation errors.
So we're talking about barewords, and barewords can only start with a subset of word characters. "∞" isn't a word character.
Does anyone else feel like this ought to get fixed? How likely is a patch for this to get accepted?
What fix are we talking about?
Changing the definition of bareword to include some symbols? Absolutely not.
Changing the type of character ∞ is in Perl to be different than in Unicode? Absolutely not.
Changing the definition of type of character ∞ is in Unicode? Absolutely not.
Perhaps you meant to compare to builtin::inf. It was added in 5.40, and it's still experimental, but I expect it to be imported by use v5.xx in the future. Adding ∞ as an alias for that is a completely different story. That would make more sense, and is entirely feasible.
In reply to Re: Unicode infinity
by ikegami
in thread Unicode infinity
by NERDVANA
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |