Alphabet
E J
moiraine at qwest.net
Fri Feb 8 22:04:43 CST 2002
> =====
> "Ovid" on http://www.perlmonks.org/
> Someone asked me how to count to 10 in Perl:
> push at A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
> shift at a;shift at a if $a[$[]eq$[;$_=join q||, at a};print $_,$/for reverse @A
>
so how would you say (print..?) the alphabet. I wrote a script to
display (in my browser) a list of the doc directories in my
/usr/share/doc dir by the letter of the alphabet. Apache's index
listing didn't do it for me, because it displayed *all* of them, and
took quite a while.
This is the default output of the script.
-----------
Alphabet
Pick a Letter:
a b c d e f g h i j k l m n o p q r s t u v w x
y z
----------
Alphabet is a link back to this page.
Each letter is a link thusly:
docs.cgi?letter=X
where X is the letter that you want.
This is the pertitant portion of the script;
------------
my $alphabet = "abcdefghijklmnopqrstuvwxyz";
for $item (split //, $alphabet) {
print $q->a({-href=>"docs.cgi?letter=$item"},$item),"\ \n";
}
---------
It's a cheesy little question, but one I was seeing a way to
obsfucate...er...however you spell that.
TIMTOWTDI
More information about the Pdx-pm-list
mailing list