Sure. Start with the Ascii value of the letter, add one, then convert back to letter.
 
for ($i = ord('a'); $i <= ord('z'); $i++)
{
    print chr($i) . "\n";
}
 
Donald C. Stephens
Associate Software Engineer
Analytics Prototyping and Scientific Programming
Moody's KMV
Tel:  212.553.1346
Fax: 574.472.5990
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, February 23, 2004 9:52 AM
To: [EMAIL PROTECTED]
Subject: counting differently

Is there a way to force a variable to walk through the alphabet the way it can numbers?
 
ie: for numbers:  $k=0; $k=$k+1; would give you 1
 
for letters $k='a'; $k=$k+1; this won't give you 'b'; but is there any way of doing this that will?


-----------
The information contained in this e-mail message, and any attachment, is confidential and for use solely by the intended recipient. If you have received this message in error, please delete this message immediately. Although Moody's KMV makes every effort to protect its computing environment from malicious code, Moody's KMV is not responsible for any virus or other type of suspect code that may be transferred via this e-mail message.
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to