[EMAIL PROTECTED] wrote:
>
> 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?
But ++$a will, because it is magic in this context. (See 'perldoc
perlop', "Auto-increment and Auto-decrement").
For example:
for ($i = 'a'; $i ne 'zzz'; ++$i) { print "$i\n"; }
Or
print "$_\n" for ('a'..'z);
HTH
--
Brian Raven
-----------------------------------------------------------------------
The information contained in this e-mail is confidential and solely
for the intended addressee(s). Unauthorised reproduction, disclosure,
modification, and/or distribution of this email may be unlawful. If you
have received this email in error, please notify the sender immediately
and delete it from your system. The views expressed in this message
do not necessarily reflect those of LIFFE Holdings Plc or any of its subsidiary
companies.
-----------------------------------------------------------------------
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs