Re: iterate the A B C
- From: "A. Sinan Unur" <1usa@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 16 Aug 2006 13:12:18 GMT
"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
.
- References:
- iterate the A B C
- From: ilany
- Re: iterate the A B C
- From: ilany
- Re: iterate the A B C
- From: anno4000
- Re: iterate the A B C
- From: a
- iterate the A B C
- Prev by Date: FAQ 3.22 How can I compile Perl into Java?
- Next by Date: Re: Conditional 'use' depending of a variable rather than a constant ?
- Previous by thread: Re: iterate the A B C
- Next by thread: Re: iterate the A B C
- Index(es):
Relevant Pages
|