Re: range operator vs. unicode

[email protected] ("Rafael Garcia-Suarez")
Newsgroups perl.unicode,perl.perl5.porters
Message-ID <[email protected]>
On 08/06/06, Dan Kogai <[email protected]> wrote:
> On the other hand, ranges in regexp and C<tr///> works.  You may
> consider this inconsistent but range operator must accept variables
> like <tt>($start .. $end)</tt> while character ranges in regexp is
> constant.

I don't find this particularly inconsistent. Ranges in tr/// and in []
are between characters, but the range operator operates on strings :

[rafael@localhost ~]$ perl -l
print for "zy" .. "aab"
__END__
zy
zz
aaa
aab

Sure, we can extend the magic to ensure that the increment of a
variable that holds "\N{omega}" is "\N{alpha}\N{alpha}". But I feel
that dragons might be dormant here...
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.