Why 'z'..'a' is not empty?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


The following code shows that 'z'..'a' is not empty. But perlop says
the following. So it should return empty list. Does anybody know why
'z'..'a' is not empty?

"In list context, it returns a list of values counting (up by ones)
from the left value to the right value. If the left value is greater
than the right value then it returns the empty list."

~/linux/test/perl/man/perlop/dot_dot/list_context$ cat main.pl
#!/usr/bin/env perl

use warnings;

print join(',', 1..10), "\n";
print join(',', 10..1), "\n";
print join(',', 'a'..'z'), "\n";
print join(',', 'z'..'a'), "\n";

~/linux/test/perl/man/perlop/dot_dot/list_context$ ./main.pl

~/linux/test/perl/man/perlop/dot_dot/list_context$ perl --version

This is perl 5, version 14, subversion 2 (v5.14.2) built for darwin-
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2011, Larry Wall

Binary build 1402 [295342] provided by ActiveState http://www.ActiveState.com
Built Oct  7 2011 15:58:41

Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5 source

Complete documentation for Perl, including FAQ lists, should be found
this system using "man perl" or "perldoc perl".  If you have access to
Internet, point your browser at http://www.perl.org /, the Perl Home

Site Timeline