Re: iterate the A B C



"a" <a@xxxxxxxx> wrote in WDEEg.407085$iF6.218295@pd7tw2no:">news:WDEEg.407085$iF6.218295@pd7tw2no:


<anno4000@xxxxxxxxxxxxxxxxxxxxxx> ¼¶¼g©ó¶l¥ó·s»D
:4kg8eeFbtfq9U2@xxxxxxxxxxxxxxxxx
ilany <ilan.yaniv@xxxxxxxxx> wrote in comp.lang.perl.misc:
....
No need for further assistance.

Oh yes, there is.

I got it:

print "All Letters\n";
for $list(C..Z) {
print "$list\n";
}

You're running without strict and warnings. The variable $list
should be declared lexical. C and Z shouldn't be barewords.
Code in blocks should be indented.

....

I would like to iterate multiple set of characters. That is,
a..z, A..Z, 0..9
so how can I do the following?
for $list(A..Z and a..z and 0..9){
print "$list\n";
}

#!/usr/bin/perl

use strict;
use warnings;

print for 'A' .. 'Z', 'a' ... 'z', '0' ... '9';
print "\n";

__END__


perldoc perlop

Read "Range Operators" and "Comma Operator"

Sinan

--
A. Sinan Unur <1usa@xxxxxxxxxxxxxxxxxxx>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html

.



Relevant Pages